Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Allow alternate websocket implementations #642

Closed
wants to merge 1 commit into from

1 participant

@mdlavin

I was trying to use the socket.io-client to test a socket.io server and I wanted to be able to tweak exact behavior on the underlying WebSocket implementation. Because socket.io-client hardcoded exactly which WebSocket implementations were used, it was hard/impossible to achive what I was wanted.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 7, 2014
  1. @mdlavin
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/transports/websocket.js
View
10 lib/transports/websocket.js
@@ -53,11 +53,13 @@
WS.prototype.open = function () {
var query = io.util.query(this.socket.options.query)
, self = this
- , Socket
+ , Socket = this.socket.options.webSocketImpl
- // if node
- Socket = require('ws');
- // end node
+ if (!Socket) {
+ // if node
+ Socket = require('ws');
+ // end node
+ }
if (!Socket) {
Socket = global.MozWebSocket || global.WebSocket;
Something went wrong with that request. Please try again.