-
Notifications
You must be signed in to change notification settings - Fork 572
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
Cannot read property 'handleUpgrade' of undefined #473
Comments
This prevents us from upgrading to cc: @kapouer |
This was referenced Jan 24, 2017
The same issue also happens when using an already listening server: 'use strict';
const eioc = require('engine.io-client');
const eio = require('engine.io');
const http = require('http');
const server = http.createServer();
server.listen(3000, () => {
const engine = eio.attach(server);
engine.on('connection', (socket) => {
socket.on('message', (data) => socket.send(data));
socket.on('close', () => console.log('close'));
});
const socket = eioc('http://localhost:3000');
socket.on('open', () => socket.send('foo'));
socket.on('message', (data) => console.log(data));
socket.on('close', () => console.log('close'));
}); |
Hit this myself, any suggestions for a fix? |
@exsilium #459 (comment) or apply this patch. |
@lpinca Appreciated! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note: for support questions, please use one of these channels: stackoverflow or slack
You want to:
Current behaviour
An error is thrown when not using
Server.prototype.attach
directly or indirectly.Steps to reproduce (if the current behaviour is a bug)
Run the following the test case
Expected behaviour
The above example should work without throwing errors.
Setup
Other information (e.g. stacktraces, related issues, suggestions how to fix)
It seems that issue has been introduces in 7e50871 as the
init
method is only called whenattach
is used.The text was updated successfully, but these errors were encountered: