from Hacker News

H2tunnel – ngrok alternative for Node.js in 600 LOC and no dependencies

by boronine on 10/15/24, 7:44 AM with 13 comments

  • by boronine on 10/15/24, 7:44 AM

    I was able to keep my code small by leveraging existing protocols: TLS for authentication and HTTP2 for multiplexing, stuffing simultaneous HTTP1 requests onto a single TLS-encrypted tunnel socket.

    Hopefully I'll make it on the hall of fame [1] :)

    [1] https://github.com/anderspitman/awesome-tunneling

  • by anshumankmr on 10/17/24, 8:26 AM

    Awesome. My company had blocked Ngrok, will try this out when I am back from my leave.
  • by throwaway2016a on 10/17/24, 4:03 PM

    Clearly a lot of work went into this so kudos for that.

    I do think it missing the point a tiny bit though. For me the primary use of Ngrok is to automatically get sub a domain with TLS and this seems to be outsourcing that to Caddy. And also I need to run a server. If I was going to run a server and run caddy I'd probably just use SSH -L directly.

    Also SSH -L is a TCP/IP level tunnel so I'm missing something regarding why the HTTP/2 multiplexing is necessary vs just using the tunnel as is.