Skip to content

digest auth for websocket proxying #890

Closed
@oskbor

Description

@oskbor

Hi, I am trying to proxy a WebSocket to an endpoint which requires digest authentication.

 var HttpProxy = require('http-proxy'),
   http = require('http');
 var wsProxy = new HttpProxy.createProxyServer({target: 'ws://' + options.cameraIp, ws: true});
 var server = http.createServer();
 server.on('upgrade', function (req, socket, head) {
  wsProxy.ws(req, socket, head);
});

The first attempt gives a 401 (the digest challenge) which is never returned to the browser. How can I hook in / configure http-proxy to pass the 401 back to the browser when using websockets?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions