diff --git a/examples/express-embed/server.js b/examples/express-embed/server.js index 0a4a929..bbb85b1 100755 --- a/examples/express-embed/server.js +++ b/examples/express-embed/server.js @@ -11,8 +11,8 @@ var whitelist = { var server = new Server({ http: false, // we do our own - udp: false, // not interested - ws: false, // not interested + udp: false, // not interested + ws: false, // not interested filter: function (params) { // black/whitelist for disallowing/allowing specific clients [default=allow all] // this example only allows the uTorrent client diff --git a/lib/server/parse-websocket.js b/lib/server/parse-websocket.js index 0900fdd..ec4e606 100644 --- a/lib/server/parse-websocket.js +++ b/lib/server/parse-websocket.js @@ -56,8 +56,8 @@ function parseWebSocketRequest (socket, opts, params) { // to reduce memory usage. if (socket.upgradeReq) { socket.ip = opts.trustProxy - ? socket.upgradeReq.headers['x-forwarded-for'] || socket.upgradeReq.connection.remoteAddress - : socket.upgradeReq.connection.remoteAddress.replace(common.REMOVE_IPV4_MAPPED_IPV6_RE, '') // force ipv4 + ? socket.upgradeReq.headers['x-forwarded-for'] || socket.upgradeReq.connection.remoteAddress + : socket.upgradeReq.connection.remoteAddress.replace(common.REMOVE_IPV4_MAPPED_IPV6_RE, '') // force ipv4 socket.port = socket.upgradeReq.connection.remotePort if (socket.port) { socket.addr = (common.IPV6_RE.test(socket.ip) ? '[' + socket.ip + ']' : socket.ip) + ':' + socket.port diff --git a/server.js b/server.js index 2636242..f7a2a62 100644 --- a/server.js +++ b/server.js @@ -403,7 +403,7 @@ Server.prototype.onHttpRequest = function (req, res, opts) { } if (self.destroyed) return res.end() - delete response.action // only needed for UDP encoding + delete response.action // only needed for UDP encoding res.end(bencode.encode(response)) if (params.action === common.ACTIONS.ANNOUNCE) {