Real-time Websockets vs XHR

#1

Is there a way client-side to manualy select another protocol? Right now if websockets don’t work, it tries other ones. What if websockets work but don’t work well (e.g. we are having issues with older thin clients). Can we dynamically switch protocol (or force it at startup)?

#2

Here you go: https://docs.meteor.com/environment-variables.html#DISABLE-WEBSOCKETS

#3

Thank you @bmanturner
This disables websockets completely, I want them by default but clients should be able to opt not to use them

#4

I’ve not tried but I think this May work. They are environment variables, then you can use, on the server side:
process.env.ENV_VARIABLE = "something"

#5

Thanks @minhna, I am referring to the client side, so ddp-client / sockjs, changing the protocol whitelist