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.
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.
1# punch a tunnel to peer.bravo and echo back what we hear 2import asyncio 3from warpgate import Gate, TCP, peer 4 5async def main(): 6 async with Gate("peer.alpha") as gate: 7 link = await gate.connect( 8 peer.find("peer.bravo"), 9 transport=TCP, 10 ) 11 async with link: 12 await link.send(b"Hello world") 13 async for msg in link: 14 print(msg) 15 16asyncio.run(main())
1# accept inbound peers across every NIC and IP family 2import asyncio 3from warpgate import Gate 4 5async def handle(pipe, msg): 6 await pipe.send(msg) 7 8async def main(): 9 gate = Gate(name="echo.host") 10 await gate.listen(handle) 11 12asyncio.run(main())
1from warpgate import Plugin, Pipe, TCP, register 2 3@register(phase="direct") 4class DirectTCP(TraversalPlugin): 5 name = "direct_tcp" 6 transport = TCP 7 8 async def run(self, reply=None): 9 route = await self.bind() 10 dest = (self.dest["ip"], self.dest["port"]) 11 pipe = await Pipe(self.transport, dest, route).connect() 12 self.result.set_result(pipe)
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.
Pick anything you've used before. We'll tell you why Warpgate is different.
| project | direct sockets | embeddable | built-in signaling | NAT traversal | no virtual NIC | open & self-host |
|---|
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.
Peers swap authenticated, end-to-end encrypted candidate messages over public MQTT brokers.
Pooled across community STUN servers. Warpgate fans probes out and reconciles results to characterize the NAT in front of you.
When all else fails — symmetric NAT on both sides, locked-down corporate egress — Warpgate falls back through public TURN.
Skip the public-key gymnastics: claim a name with namebump, point peers at it. Or use raw addresses directly.
dogdorm probes public infrastructure servers. Constantly rating the most reliable and keeping an updated server list.
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.
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.
The cascade. One-shot NAT traversal across eight plugins. Glue for everything below.
Custom async networking library that adds first-class multi-interface support to Python.
Signaling layer that passes peer messages over MQTT. Topic-per-peer, public brokers.
Open name registry. Claim a name, point peers at it — no public-key gymnastics required.
Watches public infrastructure for liveness. Tells Warpgate which servers are up before it tries.
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.