-
Notifications
You must be signed in to change notification settings - Fork 2k
websocket proxy not work in node.js version 0.10.0 #387
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
Comments
+1, I traceback from LearnBoost's up (depends on LB's distrubute, which in turn depends on NJS's node-http-proxy).
|
anyone? |
nobody cares... =) |
Hey guys, we are currently in the process of testing node 0.10.x on our platform. Sometimes the newest versions have some kinks that need to be worked out when our whole system is built on node :). A patch with tests would of course be welcome though! |
@jcrugzz is the issue reproducible for you? I have found the same problem. |
Lets call it an issue; someone want to submit a PR? |
It seems it's related to this prev issue: |
Fixed in #402 |
@indexzero Can you reopen the issue at least, since the fix is buggy as described in #402 (comment) ? (It sometimes double-sends the first chunk of the post-headers part of the proxied websocket data). I know that you said you're planning to do a full rewrite of this code for the 0.10 API but it might be worth keeping open the record of the fact that the current code is buggy... |
a simple test:
var util = require('util'),
http = require('http'),
httpProxy = require('http-proxy');
try {
var io = require('socket.io'),
client = require('socket.io-client');
}
catch (ex) {
console.error('Socket.io is required for this example:');
process.exit(1);
}
//
// Create the target HTTP server and setup
// socket.io on it.
//
var server = io.listen(8080);
server.set('transports', ['websocket']);
server.sockets.on('connection', function (client) {
util.debug('Got websocket connection');
client.on('message', function (msg) {
util.debug('Got message from client: ' + msg);
});
client.send('from server');
});
//
// Create a proxy server with node-http-proxy
//
httpProxy.createServer(8080, 'localhost').listen(8081);
//
// Setup the socket.io client against our proxy
//
var ws = client.connect('ws://localhost:8081');
ws.on('message', function (msg) {
util.debug('Got message: ' + msg);
});
in node.js version 0.10.0 we are never got a message 'Got message: from server'.. In ver. 0.8.18 all work fine..
The text was updated successfully, but these errors were encountered: