Skip to content

Commit

Permalink
redirect actual transport name (such as flashsocket), if present, to …
Browse files Browse the repository at this point in the history
…the websocket version being loaded
  • Loading branch information
einaros committed Sep 20, 2011
1 parent ab9a5a1 commit f9ea04e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/transports/websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ exports = module.exports = WebSocket;
*/

function WebSocket (mng, data, req) {
var version = req.headers['sec-websocket-version'];
var transport
, version = req.headers['sec-websocket-version'];
if (typeof version !== 'undefined' && typeof protocolVersions[version] !== 'undefined') {
return new protocolVersions[version](mng, data, req);
transport = new protocolVersions[version](mng, data, req);
}
return new protocolVersions['default'](mng, data, req);
else transport = new protocolVersions['default'](mng, data, req);
if (typeof this.name !== 'undefined') transport.name = this.name;
return transport;
};

1 comment on commit f9ea04e

@dshaw
Copy link
Contributor

@dshaw dshaw commented on f9ea04e Sep 23, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay!

Please # to comment.