Better HN
topnewbestaskshowjobs
Log inSign up

lucus16

1 karma · joined Apr 3, 2022 (4y ago) · 1 submissions

https://github.com/Lucus16
Submissions

comment 4y ago · link · parent

I also built something similar once when I needed something like ngrok but wanted to use open source:

https://github.com/tweedegolf/henk

It has a very similar approach, but uses about a hundred lines of Go instead of nginx. It's based on unix sockets created by SSH reverse tunneling, whose names are used to select the desired subdomain. This makes it possible to add more reverse proxies with just an ssh command, without changing anything on the server. It's also small enough that it's easy to add custom logic such as request logging.