0

I have try to implement it using paramiko. But I find paramiko can only launch a tunnel redirecting localhost:lport to remoteip:rport just like 'ssh -L'.

So I want to know how can I implement it using paramiko or use other library.

Thanks for your help.

user710756
  • 35
  • 5

1 Answers1

0

Unlike the -L or -R options which forward specific ports, ssh -D establishes a SOCKS proxy for application-level port forwarding.

Assuming that's what you want, then according to this answer, there are several Python modules which implements SOCKS clients/proxies, e.g. PySocks and SocksiPy. Unfortunately, I have never explored any of these options and cannot vouch for any of them.

Community
  • 1
  • 1
Shawn Chin
  • 84,080
  • 19
  • 162
  • 191
  • Thanks for your answer.I am not good at English writing and what I want is to use python to launch a socks proxy just like 'ssh -D' does, and I can use the proxy for any program which needs transport from the port on my machine, for example web browser. – user710756 May 15 '13 at 16:00