Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Second Ws Server on the same node server cause Error #1046

Closed
Binau opened this issue Mar 17, 2017 · 2 comments
Closed

Second Ws Server on the same node server cause Error #1046

Binau opened this issue Mar 17, 2017 · 2 comments

Comments

@Binau
Copy link

Binau commented Mar 17, 2017

When i create a second WS server for my node server, the first connection is closed at the connection and an error thrown.
this problem dont exist with ws v1.4 but exist with v2.x
simple exemple :

const ws = require("ws");
const http = require("http");
// Node Server
let httpServ = http.createServer();
// First Ws server
let wss1 = new ws.Server({ server: httpServ , path: '/test1/a' });
wss1.addListener('connection', (ws) => {
    console.log('CO1');
    ws.on('close', () => console.log('CL1'));
});
// Second Ws server
let wss2 = new ws.Server({ server: httpServ , path: '/test2/b' });
// listen
httpServ .listen(8080, () => {
    // make connection for first
    let wsClient = new ws(`ws://localhost:8080/test1/a`);

});

error :

Error: FIN must be set
at Receiver.getInfo (...\node_modules\ws\lib\Receiver.js:216:20)
at Receiver.startLoop (...\node_modules\ws\lib\Receiver.js:149:16)
at Receiver.add (...\node_modules\ws\lib\Receiver.js:135:10)
at Socket._ultron.on (...\node_modules\ws\lib\WebSocket.js:141:22)
at emitOne (events.js:96:13)
at Socket.emit (events.js:189:7)
at Socket.Readable.read (_stream_readable.js:381:10)
at flow (stream_readable.js:761:34)
at resume
(_stream_readable.js:743:3)
at _combinedTickCallback (internal/process/next_tick.js:74:11)

i use node v7.5.0

@lpinca
Copy link
Member

lpinca commented Mar 17, 2017

See #885.

@Binau
Copy link
Author

Binau commented Mar 17, 2017

thx !

@Binau Binau closed this as completed Mar 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants