Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • N node-http-proxy
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 482
    • Issues 482
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 102
    • Merge requests 102
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • http ... PARTY!
  • node-http-proxy
  • Issues
  • #387
Closed
Open
Issue created Mar 19, 2013 by Administrator@rootContributor

websocket proxy not work in node.js version 0.10.0

Created by: llevkin

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..

Assignee
Assign to
Time tracking