The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Stands up a hub and a peer in one process. The peer serves an HTTP
handler and never listens; the hub reaches that handler by dialing
back through the tunnel the peer opened.
go run ./examples/echo
Output:
hub → peer GET /whoami ⇒ 200 "I am the peer; the hub reached me through the tunnel"
The only inbound listener in the program is the hub's. That is the
whole point: the peer is reachable without a port, a public address, or
a hole in its firewall.
Key calls, in order:
hub.NewRegistry + hub.NewHandler mounted on a plain HTTP server, the hub side (the handler accepts the WebSocket upgrade itself).
dial.Run(ctx, dial.Options{URL, Handler}), the peer attaches over a ws:// WebSocket and serves.
registry.RoundTripper(peer) wrapped in an http.Client — the hub dials through.
For a hub that authenticates peers and derives their identity from a
token, see ../authenticated.
Command echo is the smallest end-to-end holt demo: it stands up
a hub and a peer in one process, the peer serves an HTTP handler
that only it could serve, and the hub reaches that handler by
dialing back THROUGH the tunnel the peer opened.
Nothing listens on the peer. The only inbound listener in the whole
program is the hub's — exactly the point of a reverse tunnel.
Run:
go run ./examples/echo
Expected output:
hub → peer GET /whoami ⇒ 200 "I am the peer; the hub reached me through the tunnel"