Skip to main content

The ngrok Agent SDK for Python

Project description

The ngrok Agent SDK for Python

PyPI Supported Versions MIT licensed Apache-2.0 licensed Continuous integration

Note: This is beta-quality software. Interfaces may change without warning.

ngrok is a globally distributed reverse proxy commonly used for quickly getting a public URL to a service running inside a private network, such as on your local laptop. The ngrok agent is usually deployed inside a private network and is used to communicate with the ngrok cloud service.

This is the ngrok agent in library form, suitable for integrating directly into Python applications. This allows you to quickly build ngrok into your application with no separate process to manage.

If you're looking for the previous agent downloader project, it's over here.

Installation

The published library is available on PyPI.

python -m pip install ngrok

ngrok-py officially supports Python 3.7+.

Documentation

A quickstart guide and a full API reference are included in the ngrok-py Python API documentation.

Quickstart

After you've installed the package, you'll need an Auth Token. Retrieve one on the Auth Token page of your ngrok dashboard

There are multiple examples in the /examples directory. A minimal use-case looks like the following:

async def create_tunnel():
  builder = NgrokSessionBuilder()
  session = await builder.authtoken_from_env().connect()
  tunnel = await session.http_endpoint().metadata("python tun meta").listen()
  print("tunnel: {}".format(tunnel.url()))

  res = await tunnel.forward_tcp("localhost:9000")

Platform Support

Pre-built binaries are provided on PyPI for the following platforms:

OS i686 x64 aarch64 arm
Windows *
MacOS
Linux
Linux musl
FreeBSD *

ngrok-py, and ngrok-rs which it depends on, are open source, so it may be possible to build them for other platforms.

  • Windows-aarch64 will be supported after the next release of Ring.
  • FreeBSD-x64 is built by the release process, but PyPI won't accept BSD flavors.

Dependencies

This project relies on PyO3, an excellent system to ease development and building of Rust plugins for Python.

Thank you to OpenIoTHub for handing over the ngrok name on PyPI.

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in tokio-core by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

ngrok-0.4.0-cp37-abi3-win_amd64.whl (2.3 MB view details)

Uploaded CPython 3.7+Windows x86-64

ngrok-0.4.0-cp37-abi3-win32.whl (2.0 MB view details)

Uploaded CPython 3.7+Windows x86

ngrok-0.4.0-cp37-abi3-musllinux_1_2_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.7+musllinux: musl 1.2+ x86-64

ngrok-0.4.0-cp37-abi3-musllinux_1_2_aarch64.whl (2.2 MB view details)

Uploaded CPython 3.7+musllinux: musl 1.2+ ARM64

ngrok-0.4.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ x86-64

ngrok-0.4.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.9 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ ARMv7l

ngrok-0.4.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.0 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ ARM64

ngrok-0.4.0-cp37-abi3-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.7+macOS 11.0+ ARM64

ngrok-0.4.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (4.0 MB view details)

Uploaded CPython 3.7+macOS 10.9+ universal2 (ARM64, x86-64)macOS 10.9+ x86-64macOS 11.0+ ARM64

ngrok-0.4.0-cp37-abi3-macosx_10_7_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.7+macOS 10.7+ x86-64

File details

Details for the file ngrok-0.4.0-cp37-abi3-win_amd64.whl.

File metadata

  • Download URL: ngrok-0.4.0-cp37-abi3-win_amd64.whl
  • Upload date:
  • Size: 2.3 MB
  • Tags: CPython 3.7+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.14.17

File hashes

Hashes for ngrok-0.4.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 9ec45e8e141224d9499f2c831db19a44eff1d7d5ea70601be27bf1d115b437a9
MD5 41c58b91a98d8e1777cd5fa1a6be9607
BLAKE2b-256 9670093055f21e4095e4bf01718ab555f90ee3c456366240836cc665ae9f718d

See more details on using hashes here.

File details

Details for the file ngrok-0.4.0-cp37-abi3-win32.whl.

File metadata

  • Download URL: ngrok-0.4.0-cp37-abi3-win32.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: CPython 3.7+, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.14.17

File hashes

Hashes for ngrok-0.4.0-cp37-abi3-win32.whl
Algorithm Hash digest
SHA256 ba925b83a1493c3d1b0fe5076361753c6e7430d7de66e921cabe32298b1807a2
MD5 1b1115a686b013619d37907ea9b313ed
BLAKE2b-256 4ee77c6850c6307224ebbaa481968428dff7aea7a9ca663ce2b6e829a32b4753

See more details on using hashes here.

File details

Details for the file ngrok-0.4.0-cp37-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for ngrok-0.4.0-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 7414f4060fe6cd3b350914627dad6b8f07d11414916a24b35fcaa47e3fa21fea
MD5 7b7bcc65824a33d202cfc8fe9640a811
BLAKE2b-256 35a89aaa7b0009bddcc2d29ab5cd6fac6963372b242b11f23da1aff2fc6fa1c5

See more details on using hashes here.

File details

Details for the file ngrok-0.4.0-cp37-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for ngrok-0.4.0-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 9db1d7bc00b444cc7ef0745305d2452c914b9ef05d2cb5d899e57f21e784f20b
MD5 e87c42bc51c0b74fe884ecdec6bcebb1
BLAKE2b-256 0c6a76e84db3735adf89b646920ecfe0e8432487bbf83e30d7178078cc4ab354

See more details on using hashes here.

File details

Details for the file ngrok-0.4.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ngrok-0.4.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f9c22b162e852c9d37d0febcbd65ebeeefbe97607c9d63a5d99a07014f52f48b
MD5 3c75ec57cfda3ba5bb22e18944db2366
BLAKE2b-256 42684f3e20ac3ca63d112ce31fe5ec56cb7836e8098b30b4625aba5a87b22f60

See more details on using hashes here.

File details

Details for the file ngrok-0.4.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for ngrok-0.4.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 8060f7e771cccc4f2221ef6f7771c0a3ba5d1df4aae54eb7605c9857b28164c9
MD5 ff118bf7fc639030afbc379e55b98440
BLAKE2b-256 c003efd985e4dd533f4d870825a23463805fb21a3a87d39e6fae88fd81f2abd0

See more details on using hashes here.

File details

Details for the file ngrok-0.4.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ngrok-0.4.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9ea5f458b98e31b05a9889017c85dc6250c751f7d6307c7d6d8e467f63327dae
MD5 c707c50778d87e0893f9e6f5052c9a6c
BLAKE2b-256 df6b7b4483f00c8d774675061aa7045ee5465f2d85e908437a520ce9763fabde

See more details on using hashes here.

File details

Details for the file ngrok-0.4.0-cp37-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ngrok-0.4.0-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a8c34071467e2a4f918f9a6520803f452ccc3ae70633925e78480391bdb2cee0
MD5 ae23152be27db43ae0deb8fbacfe9cd4
BLAKE2b-256 b9f15ce19bfc7690fac0de39a4cca1af06ad9fbc2534082ca7d8ac15f6f90b53

See more details on using hashes here.

File details

Details for the file ngrok-0.4.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for ngrok-0.4.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 0641e9223b42a1f9464b7191b417103881791c32f0f565feb33079b50d0ad1b6
MD5 e556538224c65cef266c4d3049cac26a
BLAKE2b-256 400ca21e9bdd4ac748db0dae83664a5a5852315bf7b74524bfc362526c08eddf

See more details on using hashes here.

File details

Details for the file ngrok-0.4.0-cp37-abi3-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for ngrok-0.4.0-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 73396fd81a7a90bc2e2c8b9354f8c907e15e8693418d5f49553535d8c864a047
MD5 8fd151c6efe9c53acc2ae184177116c5
BLAKE2b-256 8fd0d1e3392a200e57cc9300b2d02d904402be8a358f1d53beb384341f597833

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page