jquery-websocket icon indicating copy to clipboard operation
jquery-websocket copied to clipboard

Detecting when WebSockets is not supported in the client

Open t3chn0r opened this issue 13 years ago • 0 comments

Hi there! Just started using this plugin. One thing I was having trouble with was detecting if websockets is not supported on the client to be able to fall back to long polling.

Checking the source code it seems that the ws variable will contain an object even in the case websockets is not supported: { send: function(m){ return false; }, close: function(){} }.

Should it be better to just return false instead so we can check for ws === false to be able to take the necessary steps for the fallback?

Maybe I'm missing something, how are you detecting today if websockets are not supported in the client with this plugin?

t3chn0r avatar Mar 13 '13 12:03 t3chn0r