Permalink
Browse files

Merge branch 'master' of github.com:socketstream/socketstream

  • Loading branch information...
2 parents c91a850 + 435f472 commit 2b86b1dccbf06d50552a81218efeea60444bab50 Owen Barnes committed Sep 30, 2012
Showing with 6 additions and 0 deletions.
  1. +3 −0 lib/websocket/transports/socketio/index.js
  2. +3 −0 src/websocket/transports/socketio/index.coffee

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -35,6 +35,9 @@ module.exports = (ss, emitter, httpServer, config = {}) ->
try
[responderId, content] = utils.parseWsMessage(msg)
clientIp = socket.manager.handshaken[socket.id].address.address
+ if socket.manager.handshaken[socket.id].headers['x-forwarded-for']
+ clientIp = socket.manager.handshaken[socket.id].headers['x-forwarded-for'].split(',')[0]
+
meta = {socketId: socket.id, sessionId: socket.sessionId, clientIp: clientIp, transport: 'socketio'}
emitter.emit responderId, content, meta, (data) ->
socket.send(responderId + '|' + data)

0 comments on commit 2b86b1d

Please sign in to comment.