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?
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?
You can achieve that by using environment variables. Remember to always do this on server, either by using
/server/lib
or/lib/server
folder orMeteor.isServer
flag. This will do the trick:You can read more about using environment variables with Meteor on Meteorpedia.
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
This project might help folks who get here: https://github.com/cult-of-coders/fusion