Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

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

Open
PoetGcc opened this issue Jul 4, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@PoetGcc
Copy link

PoetGcc commented Jul 4, 2023

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)
@ading2210 ading2210 added the enhancement New feature or request label Jul 4, 2023
@PoetGcc
Copy link
Author

PoetGcc commented Jul 5, 2023

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants