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
  • #627
Closed
Open
Issue created Apr 22, 2014 by Administrator@rootContributor

websocket proxy,what if the sever reject the connect with status other than 101

Created by: kd128

it happen when sever dothing like

var http = require('http');
var server = http.createServer(function (req, res) {
......//do normal request
}).listen(1337);


var accept  = function(request){
  if(ok){
    return true;
  } else {
    return false;
  }
}

server.on('upgrade',function (request, socket, head) {
      if(!accept(request)){//here the http-proxy will not work!
        socket.write("HTTP/1.1 406 Not Acceptable\r\n");
        socket.write("Connection: close\r\n");
        socket.write("\r\n");
        socket.end();
        return;
      }
       ......//do websocket request
 });
Assignee
Assign to
Time tracking