HTTPServer

HTTPServer

A HTTP(S) proxy server that will route requests to instances in the TorPool provided.

Constructor

new HTTPServer(tor_pool, loggeropt, proxy_by_nameopt)

Source:
Creates an instance of `HTTPServer`.
Parameters:
Name Type Attributes Description
tor_pool TorPool The pool of instances that will be used for requests.
logger Logger <optional>
Winston logger that will be used for logging. If not specified will disable logging.
proxy_by_name ProxyByNameConfig <optional>
Enable routing to specific instances or groups of instances using the username field (http://instance-1:@my-server:9050) when connecting.

Extends

  • Server

Members

logger :Logger

Source:
Winston logger.
Type:
  • Logger

proxy_by_name :ProxyByNameConfig

Source:
Configuration for "proxy by name" feature.
Type:

tor_pool :TorPool

Source:
The pool of instances that will be used for requests.
Type:

Methods

(async) listen(port, hostopt) → {Promise}

Source:
Binds the server to a port and IP Address.
Parameters:
Name Type Attributes Default Description
port number The port to bind to
host string <optional>
"::" Address to bind to. Will default to :: or 0.0.0.0 if not specified.
Returns:
Type
Promise

Events

instance-connection

Source:
Fires when the proxy has made a connection through an instance using HTTP or HTTP-Connect.
Parameters:
Name Type Description
instance TorProcess Instance that has been connected to.
source InstanceConnectionSource Details on the source of the connection.