new HiddenServer(context, connectionListeropt)
Wraps a net.Server, exposing it as an onion service.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
context | module:bulb/context~TorContext | Tor context to create onion. | |
connectionLister | module:bulb/network~HiddenServer~ConnectionListener | <optional> | Function to handle incoming connections |
- Source
Methods
address() → {module:bulb/network~HiddenServer~Address}
Returns the hidden service's address
- Source
Returns:
listen(addOnionOptions) → {Promise.<module:bulb/network~HiddenServer~Address>}
Calls the underlying net.Socket#listen, then establishes a connection as on onion service using the current tor context.
Parameters:
Name | Type | Description |
---|---|---|
addOnionOptions | module:bulb/commands~ControlCommand~AddOnionOptions |
- Source
Returns:
- Type:
- Promise.<module:bulb/network~HiddenServer~Address>
Type Definitions
Address
Type:
Properties- object
Name | Type | Description |
---|---|---|
host | string | Onion address for this service. |
port | number | Virtual port on the onion service. |
- Source
ConnectionListener(connection)
Handles incoming connections.
Parameters:
Name | Type | Description |
---|---|---|
connection | net. |
- Source