这是我的代码
from sshtunnel import SSHTunnelForwarder
import requests
server = SSHTunnelForwarder(
(MY_IP, 22),
ssh_username=MY_USERNAME,
ssh_password=MY_PASSWORD,
remote_bind_address=('127.0.0.1', 5555)
)
server.start()
print(server.local_bind_port)
# work with `SECRET SERVICE` through `server.local_bind_port`.
print requests.get("http://127.0.0.1:"+str(server.local_bind_port))
server.stop()
我得到错误
2016-03-24 12:35:32,864 | ERROR | Secsh channel 0 open FAILED: : Connect failed
2016-03-24 12:35:32,866 | ERROR | In #1 <-- ('127.0.0.1', 50448) to ('127.0.0.1', 5555) failed: ChannelException(2, 'Connect failed')
如何使其成为代理