I have an ssh connection as below in my local laptop:
ssh -f -N -D 3232 USER@IP
now in telepot which using from urllib3 i want to pass all connections to this ssh connection because Telegram servers has been banned in my office.
I read this and do what it said. but when I use this:
proxy_url = 'http:localhost:3232
I get this error:
urllib3.exceptions.ProxyError: ('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f22968e5710>: Failed to establish a new connection: [Errno 111] Connection refused',))
How can i connect to this server?
If you use older version of
urllib3you ,ust upgrade it usingsudo pip install urllib3 --upgrade. Then you must installPySocksusingsudo pip2 install PySocks. After these two steps you must change the code here to this: