Constructor
new SOCKSServer(tor_pool, loggeropt, proxy_by_nameopt)
- Source:
Creates an instance of `SOCKSServer`.
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 (socks://instance-1:@my-server:9050) when connecting. |
Extends
- Server
Members
logger :Logger
- Source:
Winston logger to use.
Type:
- Logger
proxy_by_name :ProxyByNameConfig
- Source:
Configuration for the "proxy by name" feature.
Type:
tor_pool :TorPool
- Source:
Pool of instances use to service 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
Type Definitions
authenticate_user_callback(allow, user)
- Source:
Callback for `authenticate_user`.
Parameters:
Name | Type | Description |
---|---|---|
allow |
boolean | Indicates if the connection should be allowed. |
user |
boolean | Indicates if the connection should have a session (authentication was successful). |
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. |