Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/proxywrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ exports.proxy = function(iface, options) {
this.removeAllListeners('connection')
this.addListener('connection', connectionListener)

const t = this;

this.on = (event, handler) => {
if(event === 'connection') {
return this.addListener('proxiedConnection', handler);
}
return t.addListener(event, handler);
}

// add the old connection listeners to a custom event, which we'll fire after processing the PROXY header
for (var i = 0; i < cl.length; i++) {
this.addListener('proxiedConnection', cl[i])
Expand Down