forward TCP connections through HTTP proxy
Forward stdio through HTTP proxy to target host. It's useful if you want to use ssh to connect to remote host through HTTP proxy.
-
edit stdio.js. Set
cfg.proxy
to your HTTP proxy server address.host: "10.167.196.133", port: 8080
-
Write these lines into ~/.ssh/config
Host choose_a_host_name PorxyCommand /usr/bin/node /path/to/stdio.js 1.2.3.4 22
-
use
ssh choose_a_host_name
to connect to host through the HTTP proxy
Forward tcp connection to remote host through HTTP proxy.
-
copy
example.json
toconfig.json
. And editconfig.json
. Format:{ "interactive": <true or false. Can user interactive with tcp.js. Set to false if you want tcp.js run as a daemon.>, "local": { "listen": <port number or a filename. Which port should tcp.js listen on> }, "target": { "host": <null or ip address. Which target host should tcp.js forward to. null means disable auto forward.>, "port": <number. Which target port should tcp.js forward to> }, "proxy": { "host": <ip address. The server ip of HTTP proxy server>, "port": <port. The server port of HTTP proxy server> } }
-
run
node tcp.js config.json
-
let your application to connect to local listen port.
The HTTP proxy server MUST support "CONNECT" method.
MIT License