Run on http AND https?

131 views
Skip to first unread message

Peter Buzanits

unread,
Apr 22, 2014, 3:44:34 PM4/22/14
to eas...@googlegroups.com
I have EasyRTC running unencrypted on Port 8080. I can make it run encrypted, but not every Browser can deal with that.

So my intention is to run it on two ports: with http on 8080 and with https on 8443.

I have experimented a while in server.js but I cannot figure out how to achieve that. If anyone had an idea about this, that would be great appreciated.

Thanks, Peter

Rod Apeldoorn

unread,
Apr 22, 2014, 4:52:19 PM4/22/14
to eas...@googlegroups.com
Hi Peter,

Within your Node.js application:
  • Not possible. EasyRTC was written to accept a single Express server object. As far as I know, each Express server object can only listen to a single port.
  • It is possible to write a parallel Express server which auto-forwards all HTTP requests to HTTPS.
External to your Node.js application:
  • Possible. You can set up a proxy server which accepts both HTTP and HTTPS traffic. Any SSL is handled there. Traffic is then forwarded via a private network to the EasyRTC server on the same port. We've had success with HAProxy to achieve this. Note that the HAProxy server also adds performance and security features.
I am unaware of any modern browsers unable to handle SSL, so I am interested which ones you are concerned about.

Rod Apeldoorn,
EasyRTC Server Lead,


Peter Buzanits

unread,
Apr 22, 2014, 5:37:13 PM4/22/14
to eas...@googlegroups.com
Thank you for your quick reply!

Firefox for Android can handle https of course, but when I ran my webapp and easyrtc over https it did not work. FF could not connect to the signaling server. It worked fine with FF and Chromium on Ubuntu 12.04, but not in Android. I have not done much research on that and simply switched back to http.

Of course I could switch it to https again and provide a link to demonstrate that - it is only a test server.

Peter

Peter Buzanits

unread,
Apr 23, 2014, 7:54:36 AM4/23/14
to eas...@googlegroups.com
I solved it now with an external solution. I did not use HAProxy, which seemed to be to heavy for just doing SSL wrapping. I used stunnel to forward the encrypted port 8443 to the unencrypted 8080.

Now FF and Chrome can connect encrypted while FF for Android can go unencrypted. No idea, why this does not work encrypted. It shows an error, that it is not able to connect to the signalling server.

If someone wants to figure out what is the problem with Android an encryption, here is my testserver... You can go to "chat without login" and open a chatroom there.

http://videochat.icb.at  and
https://videochat.icb.at

I'm sure I am not the only one who wants to run a WebRTC application on Android encrytped. So this problem could affect many others...

Peter

Eric Davies

unread,
Apr 24, 2014, 12:18:00 PM4/24/14
to eas...@googlegroups.com
Hi Peter,

Our tawk.com application is runs fine with android (chrome and firefox) and it's using SSL.

I see your site is using php and hence the pages aren't being served by express. I'm not a server guy but I suspect your difficulty may be that your browser thinks that your pages are secure so it will try to use wss instead of ws by default when connecting to the socket server. In your easyrtc.setSocketUrl call, try using the prefix "ws:" to force the use of non ssl sockets.

Eric.
Reply all
Reply to author
Forward
0 new messages