vi / websocat

Command-line client for WebSockets, like netcat (or curl) for ws:// with advanced socat-like functions
MIT License
6.73k stars 259 forks source link

How to connect through a corporate proxy with authentication #102

Closed SadarSSI closed 3 years ago

SadarSSI commented 3 years ago

Hello,

Is there a way to go through a corporate proxy with authentication before connecting to the server ? wss//xxxx

In my case, I am trying to do ssh to a server

W10 Client -> Coporate Proxy with authentication (Domain\User:Passwd@proxy:3129) -> websocat server (wss://myserver.com)-> ssh server (user@sshserver:10234)

Thanks for your help

vi commented 3 years ago

Can you use https://github.com/larryhou/connect-proxy to jump the authenticated proxy, getting to unencumbered 443 port?

vi commented 3 years ago

Approximate command line:

websocat -t - --ws-c-uri=wss://xxxx  --tls-domain=xxxx  ws-c:ssl-connect:cmd:'connect-proxy -H proxy:3129 xxxx 443'

You'll probably need to:

  1. Obtain connect-proxy for Windows
  2. Fiddle with command line to make it work on Windows
  3. Set connect-proxy's options and environment variables for authentication
  4. Set actual URL and hostname for Websocket connection
  5. Integrate that with an SSH client

There is no built-in HTTP proxy support in Websocat at the moment, only SOCKS5 proxy.

SadarSSI commented 3 years ago

Ok, thank you very much for your answer