Proxy Utilities¶
The darc.proxy
module provides various proxy support
to the darc
project.
To tell the darc
project which proxy settings to be used for the
requests.Session
objects and selenium.webdriver.Chrome
objects, you can specify such information
in the darc.proxy.LINK_MAP
mapping dictionarty.
-
darc.proxy.
LINK_MAP
: DefaultDict[str, Tuple[types.FunctionType, types.FunctionType]]¶ LINK_MAP = collections.defaultdict( lambda: (darc.requests.null_session, darc.selenium.null_driver), dict( tor=(darc.requests.tor_session, darc.selenium.tor_driver), i2p=(darc.requests.i2p_session, darc.selenium.i2p_driver), ) )
The mapping dictionary for proxy type to its corresponding
requests.Session
factory function andselenium.webdriver.Chrome
factory function.The fallback value is the no proxy
requests.Session
object (null_session()
) andselenium.webdriver.Chrome
object (null_driver()
).See also
darc.requests
–requests.Session
factory functionsdarc.selenium
–selenium.webdriver.Chrome
factory functions