Skip to main content

Pinggy

PyPI Python versions License

Official Python SDK for Pinggy — expose a local server to the public internet through a managed tunnel. Wraps the native libpinggy library with a small, ergonomic API.

Supports HTTP, TCP, TLS, TLS-over-TCP, and UDP tunnels with multi-port forwarding, authentication, header rewriting, a built-in web debugger, HAProxy PROXY-protocol support, and auto-reconnect.

Installation

pip install pinggy

Wheels for Linux, macOS, and Windows bundle the native libpinggy library — no extra setup required. Python 3.6+.

Quick start

import pinggy

tunnel = pinggy.start_tunnel(forwardto="localhost:8080")
print("Public URLs:", tunnel.urls)

tunnel.wait()  # block until the tunnel ends

start_tunnel() runs the tunnel in a background thread and blocks until the tunnel is established (so tunnel.urls is populated) or raises RuntimeError if it fails to start.

For a TCP tunnel, an authenticated tunnel, or any other configuration, pass the relevant kwargs:

tunnel = pinggy.start_tunnel(
    forwardto="localhost:22",
    type="tcp",
    token="your_token_here",
)

Reacting to events

Either subclass BaseTunnelHandler:

class MyHandler(pinggy.BaseTunnelHandler):
    def tunnel_established(self, urls):
        print("Tunnel up:", urls)
    def disconnected(self, msg):
        print("Disconnected:", msg)

tunnel = pinggy.start_tunnel(forwardto=8080, eventclass=MyHandler)
tunnel.wait()

…or register callbacks directly on the tunnel:

import pinggy

tunnel = pinggy.Tunnel()
tunnel.add_forwarding("localhost:8080")

tunnel.on_tunnel_established = lambda urls: print("Tunnel up:", urls)
tunnel.on_disconnected       = lambda msg:  print("Disconnected:", msg)

tunnel.start(thread=True)
tunnel.wait()

Documentation

License

Apache 2.0. See LICENSE.

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

If you're not sure about the file name format, learn more about wheel file names.

pinggy-0.3.1-cp36-abi3-win_arm64.whl (2.9 MB view details)

Uploaded CPython 3.6+Windows ARM64

pinggy-0.3.1-cp36-abi3-win_amd64.whl (3.4 MB view details)

Uploaded CPython 3.6+Windows x86-64

pinggy-0.3.1-cp36-abi3-win32.whl (6.3 MB view details)

Uploaded CPython 3.6+Windows x86

pinggy-0.3.1-cp36-abi3-manylinux_2_28_x86_64.whl (6.3 MB view details)

Uploaded CPython 3.6+manylinux: glibc 2.28+ x86-64

pinggy-0.3.1-cp36-abi3-manylinux_2_28_i686.whl (6.4 MB view details)

Uploaded CPython 3.6+manylinux: glibc 2.28+ i686

pinggy-0.3.1-cp36-abi3-manylinux_2_28_armv7l.whl (5.2 MB view details)

Uploaded CPython 3.6+manylinux: glibc 2.28+ ARMv7l

pinggy-0.3.1-cp36-abi3-manylinux_2_28_aarch64.whl (7.0 MB view details)

Uploaded CPython 3.6+manylinux: glibc 2.28+ ARM64

pinggy-0.3.1-cp36-abi3-macosx_11_0_universal2.whl (10.7 MB view details)

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

File details

Details for the file pinggy-0.3.1-cp36-abi3-win_arm64.whl.

File metadata

  • Download URL: pinggy-0.3.1-cp36-abi3-win_arm64.whl
  • Upload date:
  • Size: 2.9 MB
  • Tags: CPython 3.6+, Windows ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.15

File hashes

Hashes for pinggy-0.3.1-cp36-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 50640379a11e407421e1368583cf6243b280036c63683b7b31c812ff8d8e0520
MD5 6b006b9b552c0c481aaa39c17e031139
BLAKE2b-256 229608c4a3846ff87ef0f1d53c55e071788a184978023cf04f5140933827d029

See more details on using hashes here.

File details

Details for the file pinggy-0.3.1-cp36-abi3-win_amd64.whl.

File metadata

  • Download URL: pinggy-0.3.1-cp36-abi3-win_amd64.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.6+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.15

File hashes

Hashes for pinggy-0.3.1-cp36-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 2dcb5f9d526424e763e68aab037ebbce20e4a0614562f6b656ae0634c1a613f4
MD5 4b96f296e54fe35d20f5d90aa8a4c0c1
BLAKE2b-256 cf2e75a80f54bca9a66f8c77dfa58877f06ccb322f6e1a1d18afdb520a758a9d

See more details on using hashes here.

File details

Details for the file pinggy-0.3.1-cp36-abi3-win32.whl.

File metadata

  • Download URL: pinggy-0.3.1-cp36-abi3-win32.whl
  • Upload date:
  • Size: 6.3 MB
  • Tags: CPython 3.6+, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.15

File hashes

Hashes for pinggy-0.3.1-cp36-abi3-win32.whl
Algorithm Hash digest
SHA256 b7bded4347b0d6eddfa3727913df569715f4c55e3530ed033525ea755316bf77
MD5 d232c25f2cae478830874da377b47af9
BLAKE2b-256 0fcd5e27590505f7670c9d64de10fcf797cb858151485dc90ff7fa20fe504c8e

See more details on using hashes here.

File details

Details for the file pinggy-0.3.1-cp36-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pinggy-0.3.1-cp36-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d5d0571a9db51976c61d34f949faaf5bb5b35d4e9b66500f00270fccdeda2520
MD5 4961f6de7f7af96d3999a99ce61807f9
BLAKE2b-256 be74070fa372f5714bad5140c2feaf6b02ae4b75af310ff590da78150cd3dbf4

See more details on using hashes here.

File details

Details for the file pinggy-0.3.1-cp36-abi3-manylinux_2_28_i686.whl.

File metadata

File hashes

Hashes for pinggy-0.3.1-cp36-abi3-manylinux_2_28_i686.whl
Algorithm Hash digest
SHA256 25b076062be31ee36725b5c1b3d6617b08a8b6e0a17aa99a864e3c191b88c6e9
MD5 12d3b1b75180eeb195ee7ed18e9d3b65
BLAKE2b-256 1171f56232dd58252a6a5df19fb034d4c61522ae2dddee3a02b6e7d4c54a7acb

See more details on using hashes here.

File details

Details for the file pinggy-0.3.1-cp36-abi3-manylinux_2_28_armv7l.whl.

File metadata

File hashes

Hashes for pinggy-0.3.1-cp36-abi3-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 7a86623ab0923800bbe3890ef9c6550136036786509e35ba36dd234590728b63
MD5 aacd7b8b2c7838111c9b863aaad80175
BLAKE2b-256 bc48210cb2a619373b85c7b3ee105e5da88780dd976fe0e341b532fecde188a2

See more details on using hashes here.

File details

Details for the file pinggy-0.3.1-cp36-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pinggy-0.3.1-cp36-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 b9583e0d131eefb5830a17249ccac84b48e1eac098d00555156c54d8700e60f1
MD5 fe1fdd0859bb11ec53674d58eb20401c
BLAKE2b-256 4f3ec0b6d44d486692adafb35f67b7c4d790f6f12fa0a90a07ff52ead79b5da7

See more details on using hashes here.

File details

Details for the file pinggy-0.3.1-cp36-abi3-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for pinggy-0.3.1-cp36-abi3-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 3c2207c95f7083819d2b1f0ca4eb0a0efa2fe8b2c20b648ad968ca786ba45b57
MD5 cd87be7ea5a14f92d6013f951db63f5c
BLAKE2b-256 ae26eb910074d4d6abb9877b4cdf30c6579d8f90027214c45d84a7ac4ad99daf

See more details on using hashes here.

Supported by

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