websocket-multiplex
websocket-multiplex copied to clipboard
Close socket inside channel
The following example code does not work correctly, the end method is undefined.
var ann = multiplexer.registerChannel('ann');
ann.on('connection', function(conn) {
conn.write('Ann says hi!');
conn.on('data', function(data) {
conn.write('Ann nods: ' + data);
conn.end();
});
});
If I log the "conn" variable with console.log it outputs:
{ conn: { _session: { ....
So I'll have to call conn.conn.end to get this to work.
node v0.10.33