Skip to main content

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.

Metadata

Release files for ngrok 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for ngrok 0.4.0
File
ngrok-0.4.0-cp37-abi3-win_amd64.whl CPython 3.7 abi3 Windows x86-64 Details
ngrok-0.4.0-cp37-abi3-win32.whl CPython 3.7 abi3 Windows x86-32 Details
ngrok-0.4.0-cp37-abi3-musllinux_1_2_x86_64.whl CPython 3.7 abi3 Linux musl 1.2+ x86-64 Details
ngrok-0.4.0-cp37-abi3-musllinux_1_2_aarch64.whl CPython 3.7 abi3 Linux musl 1.2+ ARM64 Details
ngrok-0.4.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.7 abi3 Linux glibc 2.17+ x86-64 Details
ngrok-0.4.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl CPython 3.7 abi3 Linux glibc 2.17+ ARMv7l Details
ngrok-0.4.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.7 abi3 Linux glibc 2.17+ ARM64 Details
ngrok-0.4.0-cp37-abi3-macosx_11_0_arm64.whl CPython 3.7 abi3 macOS 11.0+ ARM64 Details
ngrok-0.4.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl CPython 3.7 abi3 macOS 10.9+ x86-64, macOS 11.0+ ARM64, macOS 10.9+ universal2 (ARM64, x86-64) Details
ngrok-0.4.0-cp37-abi3-macosx_10_7_x86_64.whl CPython 3.7 abi3 macOS 10.7+ x86-64 Details

Total release size: 22.9 MB

Release files / ngrok-0.4.0-cp37-abi3-win_amd64.whl

Download URL ngrok-0.4.0-cp37-abi3-win_amd64.whl
Size 2.3 MB
Tags CPython 3.7 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
9ec45e8e141224d9499f2c831db19a44eff1d7d5ea70601be27bf1d115b437a9
BLAKE2b-256 checksum
How to use checksums
9670093055f21e4095e4bf01718ab555f90ee3c456366240836cc665ae9f718d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.17

Release files / ngrok-0.4.0-cp37-abi3-win32.whl

Download URL ngrok-0.4.0-cp37-abi3-win32.whl
Size 2.0 MB
Tags CPython 3.7 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
ba925b83a1493c3d1b0fe5076361753c6e7430d7de66e921cabe32298b1807a2
BLAKE2b-256 checksum
How to use checksums
4ee77c6850c6307224ebbaa481968428dff7aea7a9ca663ce2b6e829a32b4753
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.17

Release files / ngrok-0.4.0-cp37-abi3-musllinux_1_2_x86_64.whl

Download URL ngrok-0.4.0-cp37-abi3-musllinux_1_2_x86_64.whl
Size 2.2 MB
Tags CPython 3.7 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
7414f4060fe6cd3b350914627dad6b8f07d11414916a24b35fcaa47e3fa21fea
BLAKE2b-256 checksum
How to use checksums
35a89aaa7b0009bddcc2d29ab5cd6fac6963372b242b11f23da1aff2fc6fa1c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.16

Release files / ngrok-0.4.0-cp37-abi3-musllinux_1_2_aarch64.whl

Download URL ngrok-0.4.0-cp37-abi3-musllinux_1_2_aarch64.whl
Size 2.2 MB
Tags CPython 3.7 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
9db1d7bc00b444cc7ef0745305d2452c914b9ef05d2cb5d899e57f21e784f20b
BLAKE2b-256 checksum
How to use checksums
0c6a76e84db3735adf89b646920ecfe0e8432487bbf83e30d7178078cc4ab354
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.17

Release files / ngrok-0.4.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL ngrok-0.4.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.2 MB
Tags CPython 3.7 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
f9c22b162e852c9d37d0febcbd65ebeeefbe97607c9d63a5d99a07014f52f48b
BLAKE2b-256 checksum
How to use checksums
42684f3e20ac3ca63d112ce31fe5ec56cb7836e8098b30b4625aba5a87b22f60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.17

Release files / ngrok-0.4.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl

Download URL ngrok-0.4.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Size 1.9 MB
Tags CPython 3.7 Linux glibc 2.17+ ARMv7l abi3
SHA-256 checksum
How to use checksums
8060f7e771cccc4f2221ef6f7771c0a3ba5d1df4aae54eb7605c9857b28164c9
BLAKE2b-256 checksum
How to use checksums
c003efd985e4dd533f4d870825a23463805fb21a3a87d39e6fae88fd81f2abd0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.17

Release files / ngrok-0.4.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL ngrok-0.4.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 2.0 MB
Tags CPython 3.7 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
9ea5f458b98e31b05a9889017c85dc6250c751f7d6307c7d6d8e467f63327dae
BLAKE2b-256 checksum
How to use checksums
df6b7b4483f00c8d774675061aa7045ee5465f2d85e908437a520ce9763fabde
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.17

Release files / ngrok-0.4.0-cp37-abi3-macosx_11_0_arm64.whl

Download URL ngrok-0.4.0-cp37-abi3-macosx_11_0_arm64.whl
Size 1.9 MB
Tags CPython 3.7 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a8c34071467e2a4f918f9a6520803f452ccc3ae70633925e78480391bdb2cee0
BLAKE2b-256 checksum
How to use checksums
b9f15ce19bfc7690fac0de39a4cca1af06ad9fbc2534082ca7d8ac15f6f90b53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.17

Release files / ngrok-0.4.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl

Download URL ngrok-0.4.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Size 4.0 MB
Tags CPython 3.7 abi3 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0641e9223b42a1f9464b7191b417103881791c32f0f565feb33079b50d0ad1b6
BLAKE2b-256 checksum
How to use checksums
400ca21e9bdd4ac748db0dae83664a5a5852315bf7b74524bfc362526c08eddf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.17

Release files / ngrok-0.4.0-cp37-abi3-macosx_10_7_x86_64.whl

Download URL ngrok-0.4.0-cp37-abi3-macosx_10_7_x86_64.whl
Size 2.1 MB
Tags CPython 3.7 abi3 macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
73396fd81a7a90bc2e2c8b9354f8c907e15e8693418d5f49553535d8c864a047
BLAKE2b-256 checksum
How to use checksums
8fd0d1e3392a200e57cc9300b2d02d904402be8a358f1d53beb384341f597833
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.17

Release history Release notifications | RSS feed

1.7.0

11 release files

1.6.0

11 release files

1.5.0

11 release files

1.4.0

10 release files

1.3.0

10 release files

1.2.0

10 release files

0.8.0

10 release files

0.5.0

10 release files

This release

0.4.0 This release

10 release files

0.3.0

10 release files

0.2.3

10 release files

0.2.2

10 release files

0.1.6

1 release file

0.1.5

1 release file

0.1.4

2 release files

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page