invisibleroads/socketIO-client — pull request #7 by sajal (2012-10-09 12:02:37+00:00)
Title: Ability to send custom headers

For my webapp, everything happens behind authentication. For web UI clients it uses cookie authentication, for API clients it uses Basic auth. To allow API users to subscribe to Socket IO stream, they need to send the authentication header when making initial connection. This change allows just that.

Before:

socketIO = SocketIO('localhost', 8000)

After:

socketIO = SocketIO('localhost', 8000, headers={"Authorization" : "Basic %s" (b64encode("foo:bar"))})