Secure Websocket ( wss://)

132 views
Skip to first unread message

Ricardo Sousa

unread,
Mar 24, 2016, 7:45:35 PM3/24/16
to nginxpushstream
Did anybody find an example or configuration guideline to configure nginxpushstream to use wss ? I'm working on a prototype but the outcomes are fairly erratic on a corporate network and I'm under the impression that the problem lays on the series of proxies and firewalls the connection goes through.

Any hints on how to implement WSS would be very push appreciated.

Thanks .. Ricardo

Wandenberg Peixoto

unread,
Mar 24, 2016, 10:43:24 PM3/24/16
to nginxpu...@googlegroups.com
Ricardo,

would be better to share what you have done until now.
To wss works, basically you have to setup a SSL certificate and connect to the server using wss protocol instead of ws.

--
You received this message because you are subscribed to the Google Groups "nginxpushstream" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nginxpushstre...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ricardo Sousa

unread,
Mar 25, 2016, 7:10:42 AM3/25/16
to nginxpushstream
Hey .. Sure. BTW. Thank you for the quick reply.

SSL certificate is setup and nginx seems to be correctly configured to answer on port 8443. What I couldn't figure out so far is what I need to setup on pushstream so that my websocket connect will go through https and not http. 

Here's the javascript excerpt :

    var queryString = window.location.search;
    queryString = queryString.substring(1);
    var pushstream = new PushStream({
      host: "www.xxxxx.com.br",
      port: 8443,  
      modes: "websocket"
    });

If I use port 8888 ( the port configured for regular http ) everything works as designed , When I change it to  8443 things won't work and firebug tells me that the page it trying to connect to http://www.xxxxx.com.br:8443/ws and not https://www.xxxxx.com.br:8443/ws where it guess it should. Is there anything I need to switch in the "modes" section to use secure websocket ?

Thanks in advance, 

Ricardo

Ricardo Sousa

unread,
Mar 25, 2016, 7:39:13 AM3/25/16
to nginxpushstream
Never mind, it was a silly "useSSL: true" statement missing.

Got it working now ... Thank you for the help and congrats on the awesome work done on the module.

Ricardo 

Wandenberg Peixoto

unread,
Mar 25, 2016, 2:17:36 PM3/25/16
to nginxpu...@googlegroups.com
Great.
Just a side node, there is no restriction on the port number you must use.
It only has to be properly configured on both sides, client and server, regarding the SSL configuration
Reply all
Reply to author
Forward
0 new messages