romis2012 / python-socks

Core proxy client (SOCKS4, SOCKS5, HTTP) functionality for Python
Apache License 2.0
94 stars 18 forks source link

How to set default proxy #34

Closed Smawexi closed 1 month ago

Smawexi commented 1 month ago

How to set up a global proxy for modules developed based on the library itself, affecting asynchronous or non asynchronous modes. Similar to Pysocks, It can set a global proxy for standard library sockets in the following way, which can affect libraries like 'requets'

import socket
import socks

socks.set_default_proxy(socks.SOCKS5, "localhost")
socket.socket = socks.socksocket

I am not familiar with this library and do not know how to set a default proxy for third-party modules developed based on this library

romis2012 commented 1 month ago

This "feature" is not supported