node-multi-websockify fork of https://github.com/Simplemnt/node-websockify
Difference of this version to Simplemnt's great work is that this fork adds support also for multiple simultanous WS session to be reached from one port only. Also configuring instance is slightly easier as just single line is required. Should handle also server request upgrading accordingly.
npm install --save @sukkis/node-multi-websockify
const websockify = require('@sukkis/node-multi-websockify')
...
...
websockify(server, [{target: 'localhost:5900', path: '/path1'},{target: 'localhost:5900', path: '/path2'}]) // create websockify servers in array of objects
const express = require('express')
const app = express()
const server = require('http').Server(app)
const port = process.env.PORT || 8080
const websockify = require('@sukkis/node-multi-websockify')
server.listen(port, () => console.log('listening on *:' + port))
websockify(server, [{target: 'localhost:5900', path: '/path1'},{target: 'localhost:5900', path: '/path2'}]) // create websockify servers in array of objects
const http = require('http')
const port = process.env.PORT || 8080
const websockify = require('@sukkis/node-multi-websockify')
const server = http.createServer()
server.listen(port)
websockify(server, [{target: 'localhost:5900', path: '/path1'},{target: 'localhost:5900', path: '/path2'}]) // create websockify servers in array of objects