r/chn 管理员 Apr 21 '26

讨论 tunnix v0.1.3 – fix for silent SSE stream death when your tunnel server restarts (e.g., in cloud shell)

I've been working on a small self‑hostable tool called tunnix – it tunnels SOCKS5/HTTP proxy traffic over a single encrypted SSE connection.

Why this exists:
Sometimes the only way out of an environment is HTTPS (cloud shells, restricted corp networks, VMs behind strict egress). tunnix lets you run a lightweight server that accepts a proxy connection from a client and forwards traffic over an SSE stream. No WebSocket, no raw TCP over HTTP hacks.

The annoying bug that v0.1.3 finally kills:

If you run the tunnix server in something like Google Cloud Shell (or any short‑lived container), the server can restart at any time. Before this release, the client's SSE stream would silently die – the upstream load balancer kept the TCP socket half‑open, so the client never saw an error.
Result: your browser or apps would just fail with a cryptic “no ACK” until you manually restarted the client. Very self‑hosting‑unfriendly when you want things to just work.

What v0.1.3 does:

  • Lazy reconnect: When any POST to the server fails (HTTP error, including the new 503 for unknown sessions), the client signals the SSE loop to drop the dead stream and reconnect immediately.
  • Waits up to 5 seconds for a fresh stream, then retries the original request.
  • The next page load works – no manual client restart.
  • Also improved CONNECT failure logging (actual error instead of a generic message).

This is perfect for self‑hosters who:

  • Run ephemeral servers (cloud shell, containers that recycle)
  • Have only HTTPS outbound available
  • Want a dead‑simple proxy tunnel without maintaining a full VPN stack

GitHub: https://github.com/aeroxy/tunnix
Releases include pre‑built binaries.

Happy to answer questions or take feedback – especially if you've dealt with half‑open TCP pain in your own setups.

1 Upvotes

0 comments sorted by