Skip to content

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin Gottfried committed May 14, 2020
1 parent 716a67f commit d0ff94c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ node run server

By default, server launches on port **8090**.

Server accepts these environamental variables:

- ADDRESS ... TCP/IP address to listen on (default: localhost)
- PORT: ... TCP/IP port number to bind to (default: 8090)
- KEY_SERVER_URL ... URL to a key server. When set, WS Server will call GET
request on ``<KEY_SERVER_URL>/key/<client-key>"```. If the othe party
responds with other status code than 200, the connecting client is
immediatelly disconnected.
If KEY_SERVER_URL is undefined, client with any key can connect (default: undefined).

## Connecting a client to the server

Using websocket-proxy client, you can connect your service in your isolated
Expand Down
6 changes: 3 additions & 3 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ let CONFIG = {
server: {
host: val('ADDRESS', 'localhost'),
port: val('PORT', '8090'),
// authenticator config
// null - no authenticator (allow any key to pass)
// key server url
// empty value means no authenticator (allow any key to connect)
// http(s)://... - a url for key-master APIs
keyServerUrl: val('AUTHENTICATOR', undefined),
keyServerUrl: val('KEY_SERVER_URL', undefined),
},
client: {
key: val('KEY', 'client-1'),
Expand Down

0 comments on commit d0ff94c

Please sign in to comment.