0

I have setup a webapp to work with websockets.

This webapp worked fine over local/wired network.

I realiced (maybe im wrong) that websockets cannot work over mobile network 3G/4G because of ISP proxies. But then i saw that secured connection pass through mobile networks proxies (https://github.com/websockets/ws/issues/257).

So i created a simple self signed cert using openssl.

Finally my application works over https to host WSS protocol. So now i tried to connect with my phone using 4G but page does not load. But it works perfectly over WIFI connections, also with my desktop PC.

https://ciroreed.net:8080/

Can i provide other useful information?

EDIT

The problem was that mobile networks sometimes wont load ws:// protocol.

We solve this setting up an https server, and ofc use wss protocol also.this package for sockets https://www.npmjs.com/package/ws

k1r0s
  • 359
  • 3
  • 14

1 Answers1

2

To ensure websocket works here is my advice:

  • use wss, not ws
  • use a valid signed certificate
  • check your wss endpoint with ssllabs.com (especially for missing intermediate certificate, the most common error)
Tom
  • 4,666
  • 2
  • 29
  • 48
  • Certificates can mess sockets connection? – k1r0s May 11 '16 at 22:27
  • Anyway, why mobile cannot load my application over other networks that WIFI? – k1r0s May 11 '16 at 22:28
  • 2
    @IvanReed if correctly configured, wss should work over any network where https works. (If you configure incorrectly your certificates, the connection may breaks on some device, but ssllabs.com is your friend) – Tom May 12 '16 at 07:15
  • 1
    solved, i'll validate your answer because is the correct – k1r0s May 19 '16 at 19:06