Constructor
new Server(options)
Represents a tunnel/proxy server
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Object | Properties
|
Methods
getProxyInfoById(id) → {object}
Returns some metadata / diagnostic information about a given proxy
Parameters:
Name | Type | Description |
---|---|---|
id | string | Public key hash |
Returns:
- Type:
- object
listen(port)
Listens for tunnel clients on the port
Parameters:
Name | Type | Description |
---|---|---|
port | number |
routeHttpRequest(proxyId, request, response)
Routes the incoming HTTP request to it's corresponding proxy
Parameters:
Name | Type | Description |
---|---|---|
proxyId | String | The unique ID for the proxy instance |
request | http. | |
response | http. |
routeWebSocketConnection(proxyId, request, socket)
Routes the incoming WebSocket connection to it's corresponding proxy
Parameters:
Name | Type | Description |
---|---|---|
proxyId | String | The unique ID for the proxy instance |
request | http. | |
socket | net. |