backend.globaleaks.utils.agent

Module Contents

Functions

get_tor_agent(socks_host=b‘127.0.0.1’, socks_port=9050) An HTTP agent that uses SOCKS5 to proxy all requests through the socks_port
get_web_agent() An HTTP agent that connects to the web without using Tor
get_page(agent, url) Perform a get request to the specified url and return response content
backend.globaleaks.utils.agent.get_tor_agent(socks_host=b'127.0.0.1', socks_port=9050)[source]

An HTTP agent that uses SOCKS5 to proxy all requests through the socks_port

It is implicitly understood that the socks_port points to the locally configured tor daemon :param socks_host: the sock host :param socks_port: the sock port :return: an initialized agent using the specificed sock config

backend.globaleaks.utils.agent.get_web_agent()[source]

An HTTP agent that connects to the web without using Tor :return: A simple initialized agent

backend.globaleaks.utils.agent.get_page(agent, url)[source]

Perform a get request to the specified url and return response content :param agent: An agent to be used to issue the request :param url: A url to be fetched :return: A content returned by the url resource