Skip to content

Commit

Permalink
[minor] Starting to disable WebSockets based on AVOID_WEBSOCKETS pr…
Browse files Browse the repository at this point in the history
…operty.
  • Loading branch information
3rd-Eden committed Jul 9, 2013
1 parent 8c96362 commit 5282851
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion transformers/engine.io/client.js
Expand Up @@ -32,7 +32,10 @@ module.exports = function client() {
if (socket) socket.close();

socket = factory(primus.uri('ws', true), {
path: this.pathname
path: this.pathname,
transports: !primus.AVOID_WEBSOCKETS
? ['polling', 'websocket']
: ['polling']
});

//
Expand Down
4 changes: 3 additions & 1 deletion transformers/sockjs/client.js
Expand Up @@ -32,7 +32,9 @@ module.exports = function client() {
primus.on('outgoing::open', function opening() {
if (socket) socket.close();

socket = new Factory(primus.uri('http', false));
socket = new Factory(primus.uri('http', false), null, {
websocket: !primus.AVOID_WEBSOCKETS
});

//
// Setup the Event handlers.
Expand Down

0 comments on commit 5282851

Please sign in to comment.