Skip to content
Hoody.com

The hoody-tunnel kit provides multiplexed network tunnels between a Hoody container and external clients. A client opens a single WebSocket control connection and streams many TCP or UDP flows over it. The HTTP endpoints on this page expose the kit’s runtime state for inspection and let operators terminate sessions without holding the WebSocket themselves.

Use these endpoints to monitor active sessions, stream counts, binding inventory, and FD permit availability, to scrape Prometheus metrics, or to force-close a session with a graceful drain budget.

All endpoints live under the container-scoped tunnel host:

https://{projectId}-{containerId}-tunnel-1.{serverName}.containers.hoody.com

Standard kit health endpoint. No authentication required. Returns the kit’s status, service, build timestamp (built), start timestamp (started), process metadata (pid, fds, ip, userAgent), and a memory snapshot (memory).

This endpoint takes no parameters.

Terminal window
curl https://{projectId}-{containerId}-tunnel-1.{serverName}.containers.hoody.com/api/v1/tunnel/health

Returns Prometheus text-format metrics, including the number of active sessions, active bindings, and remaining FD permits.

This endpoint takes no parameters.

Terminal window
curl https://{projectId}-{containerId}-tunnel-1.{serverName}.containers.hoody.com/api/v1/tunnel/metrics

Returns a unified view of every active tunnel session, together with its EXPOSE and PULL bindings, stream counts, orphan count, and remaining FD budget. Use this endpoint for the most complete snapshot of tunnel state.

This endpoint takes no parameters.

Terminal window
curl https://{projectId}-{containerId}-tunnel-1.{serverName}.containers.hoody.com/api/v1/tunnel/tunnels

Returns every active tunnel session with its bindings, stream counts, and protocol version.

This endpoint takes no parameters.

Terminal window
curl https://{projectId}-{containerId}-tunnel-1.{serverName}.containers.hoody.com/api/v1/tunnel/sessions

Returns every active EXPOSE and PULL binding across all sessions, together with the owning session ID, port, kind, mode, and bind ID.

This endpoint takes no parameters.

Terminal window
curl https://{projectId}-{containerId}-tunnel-1.{serverName}.containers.hoody.com/api/v1/tunnel/bindings

WebSocket upgrade endpoint for the multiplexed tunnel session. After the upgrade, the client sends exactly one binary frame as its first message: HELLO (0x01) to open a session or, on hoody-tunnel.v2 only, JOIN (0x09) with a single-use ticket from HELLO_OK to attach a secondary socket to an existing session.

NameInTypeRequiredDescription
Sec-WebSocket-ProtocolheaderstringYesRequired. Comma-separated subprotocols to offer, in preference order: hoody-tunnel.v2, hoody-tunnel.v1, or hoody-tunnel.v2, hoody-tunnel.v1.
Terminal window
curl -i -N \
-H "Connection: Upgrade" \
-H "Upgrade: websocket" \
-H "Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==" \
-H "Sec-WebSocket-Version: 13" \
-H "Sec-WebSocket-Protocol: hoody-tunnel.v2" \
https://{projectId}-{containerId}-tunnel-1.{serverName}.containers.hoody.com/api/v1/tunnel/connect

DELETE /api/v1/tunnel/sessions/{session_id}

Section titled “DELETE /api/v1/tunnel/sessions/{session_id}”

Signals the tunnel kit to close the named session. Live sessions receive a GOAWAY(0x0001, "closed by admin") frame sent directly on the WebSocket and are force-closed after the drain budget elapses.

NameInTypeRequiredDescription
session_idpathstringYesSession ID as returned by GET /sessions
grace_msqueryintegerNoGOAWAY drain budget in ms (0-5000, default 50)
Terminal window
curl -X DELETE \
"https://{projectId}-{containerId}-tunnel-1.{serverName}.containers.hoody.com/api/v1/tunnel/sessions/sess_3f7a91c2e8b4d6f1?grace_ms=100"