Proxy Utilities¶
The darc.proxy
module provides various proxy support
to the darc
project.
- Bitcoin Addresses
save_bitcoin()
darc.proxy.bitcoin.PATH
darc.proxy.bitcoin.LOCK
- Data URI Schemes
save_data()
darc.proxy.data.PATH
- ED2K Magnet Links
save_ed2k()
darc.proxy.ed2k.PATH
darc.proxy.ed2k.LOCK
- Ethereum Addresses
save_ethereum()
darc.proxy.ethereum.PATH
darc.proxy.ethereum.LOCK
- Freenet Proxy
_freenet_bootstrap()
freenet_bootstrap()
launch_freenet()
darc.proxy.freenet.FREENET_PORT
darc.proxy.freenet.FREENET_RETRY
darc.proxy.freenet.BS_WAIT
darc.proxy.freenet.FREENET_PATH
darc.proxy.freenet.FREENET_ARGS
darc.proxy.freenet._MNG_FREENET
darc.proxy.freenet._FREENET_BS_FLAG
darc.proxy.freenet._FREENET_PROC
darc.proxy.freenet._FREENET_ARGS
- I2P Proxy
_i2p_bootstrap()
fetch_hosts()
get_hosts()
have_hosts()
i2p_bootstrap()
launch_i2p()
read_hosts()
save_hosts()
darc.proxy.i2p.I2P_REQUESTS_PROXY
darc.proxy.i2p.I2P_SELENIUM_PROXY
darc.proxy.i2p.I2P_PORT
darc.proxy.i2p.I2P_RETRY
darc.proxy.i2p.BS_WAIT
darc.proxy.i2p.I2P_ARGS
darc.proxy.i2p._MNG_I2P
darc.proxy.i2p._I2P_BS_FLAG
darc.proxy.i2p._I2P_PROC
darc.proxy.i2p._I2P_ARGS
- IRC Addresses
save_irc()
darc.proxy.irc.PATH
darc.proxy.irc.LOCK
- Magnet Links
save_magnet()
darc.proxy.magnet.PATH
darc.proxy.magnet.LOCK
- Email Addresses
save_mail()
darc.proxy.mail.PATH
darc.proxy.mail.LOCK
- No Proxy
fetch_sitemap()
get_sitemap()
have_robots()
have_sitemap()
read_robots()
read_sitemap()
save_invalid()
save_robots()
save_sitemap()
darc.proxy.null.PATH
darc.proxy.null.LOCK
- JavaScript Links
save_script()
darc.proxy.script.PATH
darc.proxy.script.LOCK
- Telephone Numbers
save_tel()
darc.proxy.tel.PATH
darc.proxy.tel.LOCK
- Tor Proxy
_tor_bootstrap()
print_bootstrap_lines()
renew_tor_session()
tor_bootstrap()
darc.proxy.tor.TOR_REQUESTS_PROXY
darc.proxy.tor.TOR_SELENIUM_PROXY
darc.proxy.tor.TOR_PORT
darc.proxy.tor.TOR_CTRL
darc.proxy.tor.TOR_PASS
darc.proxy.tor.TOR_RETRY
darc.proxy.tor.BS_WAIT
darc.proxy.tor.TOR_CFG
darc.proxy.tor._MNG_TOR
darc.proxy.tor._TOR_BS_FLAG
darc.proxy.tor._TOR_PROC
darc.proxy.tor._TOR_CTRL
darc.proxy.tor._TOR_CONFIG
- ZeroNet Proxy
_zeronet_bootstrap()
launch_zeronet()
zeronet_bootstrap()
darc.proxy.zeronet.ZERONET_PORT
darc.proxy.zeronet.ZERONET_RETRY
darc.proxy.zeronet.BS_WAIT
darc.proxy.zeronet.ZERONET_PATH
darc.proxy.zeronet.ZERONET_ARGS
darc.proxy.zeronet._MNG_ZERONET
darc.proxy.zeronet._ZERONET_BS_FLAG
darc.proxy.zeronet._ZERONET_PROC
darc.proxy.zeronet._ZERONET_ARGS
To tell the darc
project which proxy settings to be used for the
requests.Session
objects and WebDriver
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), { '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 andWebDriver
factory function.The fallback value is the no proxy
requests.Session
object (null_session()
) andWebDriver
object (null_driver()
).See also
darc.requests
–requests.Session
factory functionsdarc.selenium
–WebDriver
factory functions