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?
Asked
Active
Viewed 1,395 times
3 Answers
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.
![](../../users/profiles/347331.webp)
ddarkowski
- 126
- 4
0
For those interested, when websockets are disabled, Meteor uses sockjs which is a websockets emulator library.
More info here:
![](../../users/profiles/204074.webp)
w3jimmy
- 143
- 5