I am using private_pub which is a wrapper for faye
https://github.com/ryanb/private_pub
I wan't to disable websockets on the client side, so faye will fall back to polling, because my production environment doesn't support websockets.
It is advised to do so on the faye website:
For some applications you may need to exclude some transports from use. For example you may know your deployment environment cannot support WebSockets, or you have reasons to stick to polling. In such situations you can disable a transport like so:
client.disable('websocket');
http://faye.jcoglan.com/browser.html
I attempt to modify the private_pub.js code to disable websockets upon creation:
self.fayeClient = new Faye.Client(self.subscriptions.server);
self.fayeClient.disable('websocket'); // my modification
But I get this error: TypeError: Object # has no method 'disable'
I am pretty certain that the 'client' on the site's example is the same type as my client, because earlier on the site this code is shown: var client = new Faye.Client('http://localhost:8000/faye');
, just like how the self.fayeClient in my code is created.
Am I not understanding something about the example in the site? Or how should I disable the websockets so that my faye client will use polling instead of websockets?