Proxy TCP ports via HTTP with Chisel.
Chisel is a handy tool to proxy any tcp port via a http/s connection. Assume that you want to ssh into a server, but you don't control the firewall, and port 22 is blocked. This is usually the case when you connect to a jupyter server using jupyter hub. You may create an image that runs ssh locally, but the only way to make an external connection reach that port is via http/s.
The chisel command can be downloaded with: curl https://i.jpillora.com/chisel! | bash
You can run the chisel server with
chisel server -p 6543
This will execute the Chisel server, that creates an http server listening to port 6543. The default is 8080. The next step is to connect the chisel client that forwards the remote 22 port to the local 2222 this way:
chisel client [server-ip-or-hostname]:6543 2222:localhost:22
Finally, we can connect an ssh client in the local machine with:
ssh guillem@localhost -p 2222