architect-websocket-server
architect websocket server with websocket multiplex suport and routing.
installing
npm install architect-websocket-server
Config Format
"packagePath": "architect-websocket-server" port: 8080 host: '0.0.0.0' prefix: '/api' channels: 'printer' 'chatroom'
Usage
Boot Architect :
var path = ;var architect = ; var configPath = path;var config = architect; architect;
Configure Architect with config.js
:
moduleexports = packagePath: "architect-websocket-server" port: 8080 host: '0.0.0.0' channels: 'printer' 'chatroom' './routes';
And register your routes in ./routes/index.js
:
module { var wsserver = importswsserver; router = wsserverroutersprinter; // register routes router; ;};// Consume wsserver pluginmoduleexportsconsumes='wsserver';
Options
- port : tcp port to listent to
- host : host to listen to
- prefix : http path prefix to which SockJS is mounted.
- channels: a list of channels to create.