2

I was asked to test a meteor (js) website in a server without websockets support, how can I achieve this? How can I really know that a server is not capable of using websockets?

David Makogon
  • 2,767
  • 1
  • 19
  • 29
w3jimmy
  • 143
  • 5

3 Answers3

1

You can achieve that by using environment variables. Remember to always do this on server, either by using /server/lib or /lib/server folder or Meteor.isServer flag. This will do the trick:

Meteor.startup(function () {
  process.env.DISABLE_WEBSOCKETS = 1;
});

You can read more about using environment variables with Meteor on Meteorpedia.

ddarkowski
  • 126
  • 4
0

For those interested, when websockets are disabled, Meteor uses sockjs which is a websockets emulator library.

More info here:

https://github.com/sockjs/sockjs-node

http://www.meteorpedia.com/read/Websockets

w3jimmy
  • 143
  • 5
-1

This project might help folks who get here: https://github.com/cult-of-coders/fusion

Tivoni
  • 99
  • 1