open source · MIT · free forever

Any peer.
Any NAT.

Warpgate is a 100% open-source Python 3 library for one-shot NAT traversal. Eight plugins, every major OS back to Windows XP, IPv4 and IPv6, multi-NIC, all in one library. No relays you have to run. No keys you have to manage. No paid tier, ever — the code is MIT and the public infrastructure is community-run.

$ pip install warpgate
see the plugins
python
3.5 → latest asyncio
os
Win XP–11, Linux, macOS, BSD
ip family
IPv4 + IPv6
interfaces
multi-NIC native
plugin.cascade · 0x4F2A
try: 1/8
mqtt stun turn peer.alpha 3 NICs · v4+v6 behind CGNAT peer.bravo UPnP · IPv6 home router warpgate
link via tcp-punch 0 packets

Eight ways through. Connect with ease.

Warpgate doesn't bet on a single technique. It runs a cascade of plugins — direct, reverse, hole-punch, probe, relay, port-map — in whatever order you configure. Write your own and drop it in.

01 / direct
Direct connect
tcp · udp
02 / reverse
Reverse connect
via signaling
03 / tcp-punch
TCP simultaneous open
novel algorithm
04 / udp-punch
UDP hole punching
classic + improved
05 / probe
UDP Random probe
birthday paradox
06 / upnp
UPnP / IPv6 pinhole
router-assisted
07 / turn
TURN relay
guaranteed fallback
08 / custom
Bring your own
plugin api

Public by design.

Most NAT-traversal libraries hand you a problem: stand up your own STUN, TURN, signaling, key-distribution. Warpgate ships with a public constellation — and a monitoring service that watches it for you. Run your own when you need to. Don't, when you don't.

signaling

Sidewire — messages over MQTT

Peers swap candidates over public MQTT brokers. No bespoke rendezvous server to operate; sidewire handles the signaling.

discovery

STUN for reflexive lookup

Pooled across community STUN servers. Warpgate fans probes out and reconciles results to characterize the NAT in front of you.

fallback

TURN for the unreachable

When all else fails — symmetric NAT on both sides, locked-down corporate egress — Warpgate falls back through public TURN.

naming

Namebump — free name registry

Skip the public-key gymnastics: claim a name with namebump, point peers at it. Or use raw addresses directly.

monitoring

Dogdorm — live reliability watcher

dogdorm probes public infrastructure servers. Constantly rating the most reliable and keeping an updated server list.

warpgate MQTT STUN TURN Naming Monitor
$0

100% free. Open source. Forever.

Every line is MIT. Every server in the public set is community-run. There is no paid tier, no enterprise upsell, no closed core. Use it commercially, fork it, white-label it, host your own — we genuinely don't mind.

MIT no telemetry no signup no paid tier

Warpgate is one project in a family.

Each piece does one thing well, ships independently, and runs on the same public infrastructure. Use them together, or pull just the one you need.

Runs on what you've got. Even what you forgot.

Warpgate's pure-Python core targets the lowest common denominator on purpose. If you're maintaining a tool that has to ship to a Windows XP fleet, an embedded Linux box, a BSD jail, and an Android runtime — same library, same API.

operating systemmin versionsupport
WindowsXP SP3tier 1
Linuxkernel 2.6tier 1
macOS10.9 +tier 1
FreeBSD / OpenBSDrecenttier 1
Androidvia Termux / Chaquopytier 2
runtimeversionsnotes
CPython3.5 → 3.13primary
PyPy3.xtested
IPv4all NAT classesfirst-class
IPv6incl. pinhole / RAfirst-class
Multi-NICbind-per-interfacenative

A library for writing network code, not fighting it.

Warpgate is a complete async network programming kit: the cascade for getting a socket, plus primitives for using it. Start a connection, accept inbound peers, multiplex multiple NICs, write your own strategy.

  • async-native from Python 3.5's first asyncio
  • plugins with a stable interface
  • advanced NAT detection ships built-in
  • bring-your-own signaling, TURN, naming
1# cascade through 8 plugins until one works
2import asyncio
3from warpgate import Gate
4
5async def main():
6    gate = Gate(name="peer.alpha")
7    await gate.load_interfaces()  # every NIC
8
9    pipe = await gate.connect("peer.bravo")
10    async with pipe:
11        await pipe.send(b"hello")
12        msg = await pipe.recv()
13        print(pipe.strategy, pipe.transport)
14
15asyncio.run(main())
16
17#  direct       — refused
18#  reverse      — refused
19#  tcp-punch    ✓  via simultaneous-open
20# tcp-punch tcp
1# accept inbound peers across every NIC and IP family
2import asyncio
3from warpgate import Gate
4
5async def handle(pipe):
6    async with pipe:
7        async for msg in pipe:
8            await pipe.send(msg)
9
10async def main():
11    gate = Gate(name="echo.host")
12    await gate.load_interfaces(families=["v4", "v6"])
13    await gate.listen(handle)
14    await asyncio.Future()
15
16asyncio.run(main())
1# your own plugin — drop into the cascade
2from warpgate import Strategy, register
3
4@register(priority=15)
5class QuicCoturn(Strategy):
6    name = "quic-coturn"
7
8    async def attempt(self, ctx):
9        if not ctx.peer.supports("quic"):
10            return self.skip()
11        sock = await ctx.turn.allocate("udp")
12        return await ctx.wrap_quic(sock)

Free. Open. Yours.

Warpgate is MIT licensed — the library, every sibling project. No paid tier. No vendor lock-in. No telemetry phoning home. Fork it, ship it, run your own copy of every server.

$ pip install warpgate
read the TCP hole-punch paper