Skip to content

Commit 39514ac

Browse files
committed
emit proxyReqWs event when appropriate
It seems like we use the emit function to trigger potential event handlers registered, but from what I understand we should do this differently depending on either proxied web requests and proxied web socket requests. ref: https://github.com/http-party/node-http-proxy#listening-for-proxy-events
1 parent 551f637 commit 39514ac

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/configproxy.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,12 @@ class ConfigurableProxy extends EventEmitter {
510510
return;
511511
}
512512

513-
that.emit("proxyRequest", req, res);
513+
if (kind === "web") {
514+
that.emit("proxyRequest", req, res);
515+
}
516+
else {
517+
that.emit("proxyRequestWs", req, res, args[2]);
518+
}
514519
var prefix = match.prefix;
515520
var target = match.target;
516521
that.log.debug("PROXY %s %s to %s", kind.toUpperCase(), req.url, target);

0 commit comments

Comments
 (0)