digest auth for websocket proxying
Created by: 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?