Keeping a consistent WebSocket connection over GSM/3G networks

Mobile networks are known to cause problems with persistent connections and interfere with Internet traffic. Due to this some mobile data networks will not allow a WebSocket to connect over WS and port 80. Because of this connections should be made over WSS and port 443.

How does this affect your application?
If you are using the Pusher JavaScript library it will initially try to connect over WS and port 80. When this fails it will automatically try WSS and port 443 and successfully connect.

If you are using another client library you may need to configure the client to connect over WSS.

pusher-js (JavaScript)

The client will automatically connect. However, you can configure the client to connect over WSS by default:

var pusher = new Pusher( 'app_key', { encrypted: true } );

libPusher (iOS)

Use an encrypted connection. See:
http://lukeredpath.github.com/libPusher/html/Classes/PTPusher.html#//api/name/pusherWithKey:connectA...
Was this article helpful?
0 out of 0 found this helpful
Haven't found what you were looking for?
Submit a ticket