qwj / python-proxy

HTTP/HTTP2/HTTP3/Socks4/Socks5/Shadowsocks/ShadowsocksR/SSH/Redirect/Pf TCP/UDP asynchronous tunnel proxy implemented in Python 3 asyncio.
MIT License
1.99k stars 333 forks source link

feature request: ssh jumphosts #103

Closed keenser closed 3 years ago

keenser commented 3 years ago

Hi,

Please add ability to open ssh proxy connection through one or more ssh jumphosts (like ssh -J). Proof of concept patch can be used like: pproxy.Connection('ssh://10.100.1.1,192.168.0.1,192.168.2.1,10.200.0.1#tunnel1:password\ntunnel2:password2\ntunnel3:password3\ntunnel4:password4')

qwj commented 3 years ago

This feature is very cool, although it doesn't conform with the JUMP syntax pproxy are using. I have submitted v2.5.2 supporting this new feature. The JUMP syntax is using double underscore "__":

$ pproxy -r ssh://server1#user1:pass1__ssh://server2#user2:pass2__ssh://server3#user3:pass3

It is flexible. We can use protocol other than "ssh://" on the second or third jump:

$ pproxy -r ssh://server1#user1:pass1__socks5://server2:port2__http://server3:port3

However, using "ssh://" without preceding "ssh://" jump is illegal.