Hasty Briefsbeta

Bilingual

Show HN: Self-Hosted HTTPS Tunnel in 300 LoC with Go, Caddy, and Cloudflare

a year ago
  • #self-hosted
  • #Go
  • #HTTP-tunnel
  • Built a lightweight, self-hosted HTTP tunnel for turning localhost into a public HTTPS URL.
  • Uses a Go binary, Caddy with wildcard TLS, and a $0/month Oracle Cloud VM.
  • Alternatives like Ngrok and Cloudflare Tunnel have limitations such as session timeouts and complexity.
  • Features include WebSocket tunneling, wildcard TLS certificates, and HTTP hijacking for direct streaming.
  • Setup requires a domain name, a VM, and Go for building the application.
  • Uses Cloudflare for DNS management and automatic SSL certificate generation.
  • Engineering highlights include yamux for multiplexing and WebSocket for seamless tunneling.
  • Security measures include basic auth and scoped Cloudflare tokens.
  • Future plans include authentication support, gRPC transport mode, and Prometheus metrics.