-
instal stunnel from your package manager. This allows you to wrap any TCP protocol (ssh, postgresql, mysql) in TLS.
-
download the stunnel.conf from this gist and replace the example.com host with your custom domain (also in the ssh command below).
-
run
stunnel stunnel.confin a terminal -
connect your localhost.run tunnel on port 80 to your backend service.
ssh -R example.com:80:localhost:5432 [email protected]connects a tunnel to a local postgres on port 5432, change the port for other services -
connect your client to port 9999 (or what ever port you specified in stunnel.conf), for eg:.
psql postgresql://localhost:9999/dbnamemysql -h localhost -P9999ssh localhost -p 9999
Last active
June 26, 2023 09:16
-
-
Save tommyvn/4aad720deb4d904be00ddd065ef05e38 to your computer and use it in GitHub Desktop.
tunneling arbitrary TCP protocols like ssh or postgresql over localhost.run custom domains
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| foreground = yes | |
| pid = ./stunnel.pid | |
| [lhr] | |
| client = yes | |
| accept = localhost:9999 | |
| connect = example.com:443 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment