1
votes

I've been trying to set up my first SOCKET.IO server that simply push notifications to the clients.

Apache and socket.io are currently running on the same physical server (same IP)

on different ports. [ WEB- 443(SSL), SOCKET - 8989 ]

I've set an apache proxy server (virtualhost) leading http://www.EXAMPLE.me:1433 to

http:// localhost: 8989.

APACHECTL

< VirtualHost *:1433 >

    ServerName www.example.me:1433
    ProxyPass / http://localhost:8989/
    ProxyPassReverse / http://localhot:8989/

    SSLProxyEngine on
    SSLEngine on
    SSLCertificateFile /root/ssl/xxx.crt
    SSLCertificateKeyFile /root/ssl/ssl_xxxx.key

< /virtualHost >

SERVER

var io = require('socket.io').listen(8989);

CLIENT

var XXXX = io.connect('https://www.example.me:1443');

The browser is giving me 502 error and socket.io 'warn - websocket connection invalid'.

It works fine if i put server ip with port number 8989 but SSL wouldn't allow it.

What am I doing wrong??

1

1 Answers

1
votes

Nobody answered and I've come to a resolution of my own. I ended up building a separate server dedicated for SOCKET.IO. Also disabled any connections to SOCKET.IO on pages with SSL.