socks.GeneralProxyError: Socket error: 0x01: General SOCKS server failure

337 Views Asked by At

I am trying if a service is up or not using socket and tor but I am getting this error.

import socks
import socket


def tor_connect():
        socks.set_default_proxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", 9050, True)
        socket.socket = socks.socksocket
def connected():
        tor_connect()
        print("Connected to tor")
        s = socket.create_connection(("dest_ip", 22), timeout=5)
        print(connected)

if __name__== "__main__":
        connected()
1

There are 1 best solutions below

0
Steffen Ullrich On

"general SOCKS failure" is a return code from the SOCKS server as defined in the standard. That's all you get back from the SOCKS server in your program. For details of why the error got produced you need to actually look into the SOCKS server in the hope that there are logs which give you details about the problem.