Constructor
new DNSServer(tor_pool, dns_optionsopt, dns_timeout, loggeropt)
- Source:
Creates an instance of `DNSServer`.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
tor_pool |
TorPool | The pool of instances that will be used for requests. | |
dns_options |
Object |
<optional> |
Options that will be passed to the parent constructor. |
dns_timeout |
number | How long to wait before each outbound DNS request before timing out. | |
logger |
Logger |
<optional> |
Winston logger that will be used for logging. If not specified will disable logging. |
Extends
- UDPServer
Members
dns_timeout :number
- Source:
Timeout for each outbound DNS request
Type:
- number
logger :Logger
- Source:
Winston logger
Type:
- Logger
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.
Parameters:
Name | Type | Description |
---|---|---|
instance |
TorProcess | Instance that has been connected to. |
source |
InstanceConnectionSource | Details on the source of the connection. |