poe-api icon indicating copy to clipboard operation
poe-api copied to clipboard

How to use socks5 like this: proxy = 'socks5://{}:{}@{}:{}'.format(key, password, proxy_host, proxy_port)

Open PoetGcc opened this issue 2 years ago • 1 comments

I need set socks5 with username and password, but not work , my code like this:

proxy_host = "67.220.182.3"
proxy_port = "10001"
key = "key"
password = "password"
proxy = 'socks5://{}:{}@{}:{}'.format(key, password, proxy_host, proxy_port)

client = poe.Client(token, proxy=proxy)

PoetGcc avatar Jul 04 '23 16:07 PoetGcc

I use PySocks set proxy, change my code,like this:

   socks.set_default_proxy(socks.SOCKS5,
                            __PROXY_HOST__,
                            proxy_port,
                            username=__KEY__,
                            password=__PASSWORD__)
    socket.socket = socks.socksocket

    client = poe.Client(token)
    return client.send_message(chatbot, message.content, with_chat_break=False)

is it can work?

PoetGcc avatar Jul 05 '23 10:07 PoetGcc