new ServiceHost()
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options.cors | Object | Cors to be passed to express via the | ||
options.trust_proxy | boolean | <optional> | false | When true, the server will parse forwarding headers. This should be set when running behind a load-balancer for accurate error messages and logging |
options.listenUri | string | <optional> | http://0.0.0.0:4000 | The uri of the host interface to tell express to listen on. Defaults to `http://0.0.0.0:4001 |
options.i2pEnabled | boolean | <optional> | false | When true, this server will be available over i2p |
options.i2pSamHost | string | <optional> | 127.0.0.1 | The hostname of the i2p SAM control API. Defaults to |
options.i2pSamPort | Integer | <optional> | 7656 | The port of the i2p SAM control API. Defaults to |
options.i2pForwardHost | string | <optional> | localhost | Override i2p forward host. This defaults to |
options.i2pForwardPort | Integer | Override i2p forward post. This defaults to the port supplied in | ||
options.i2pKey | string | When set this i2p key will be used to host the service. If not set a new i2p key will be generated. Defaults to | ||
options.wsEnabled | boolean | <optional> | true | When true the server will host a dataparty websocket service. Defaults to |
options.wsPort | Integer | Port for the websocket service to listen on. Defaults to | ||
options.wsUpgradePath | string | <optional> | /ws | The path within the http server to host an upgradeable websocket. Defaults to |
options.mdnsEnabled | boolean | <optional> | true | When true, the server will publish mDNS records advertising the service and party identity |
options.runner | module:Service. | A pre-configured runner |
- Source
Members
(static) apiApp :Express
Express app
- Express
- Source
(static) router :Router
The router
- Router
- Source
(static) runner :module:Service.ServiceRunner
Dataparty service runner
- Source
Methods
(async, static) start()
Start hosting services
- Source
(async, static) stop()
Stop hosting services
- Source