DomiStyle / docker-idrac6

iDRAC 6 web interface and VNC proxy
https://hub.docker.com/r/domistyle/idrac6/
MIT License
780 stars 144 forks source link

Add support for SOCKS5 proxy #70

Open julien-sobczak opened 8 months ago

julien-sobczak commented 8 months ago

Context

BMCs often uses a private subnet which is not always accessible using a VPN connection.

We can start a SSH tunnel with port forwarding like this:

$ ssh -L 4443:<BMC_IP>:443 <remote_proxy>

But the image docker-idrac6 fails because WebSockets doesn't seem supported as reported in logs:

webSocketsHandshake: invalid client header

Proposal

Using a SOCKS5 proxy solves the issue:

$ ssh -fND 4443 <remote_proxy>
$ docker run -p 5800:5800 -p 5900:5900 -e SOCKS_PROXY_HOST=host.docker.internal -e SOCKS_PROXY_PORT=4443 -e IDRAC_HOST=<BMC_IP> -e IDRAC_PORT=443 -e IDRAC_USER=root -e IDRAC_PASSWORD=XXX domistyle/idrac6

But this implies a few changes: