I am running this example chat app https://github.com/btford/angular-socket-io-im that uses socket.io/angular/node to make a basic im client.
However I run into trouble when I try to make it work over https.
No socket events are caught on the server, so no chat messages are sent to clients and users can't join rooms. I also get this error on the client in socket.io.js
:
Uncaught TypeError: Cannot call method 'onClose' of null
I've created an express
https
server listening on port 8000
and modified the socket definition to :
var socket = io.connect('https://localhost:8000',{secure: true, port:8000});
both in js/services.js
and in /bower_components/angular-socket-io/socket.js
Not quite sure how to go about fixing this. Thanks in advance!
I have an app that does this exact same thing :) uses socket io and uses :8080 you will need to make sure your security cert is registering that both
https://localhost
andhttps://localhost:8000
and has been added to your keychain otherwise the page will load but your socket connections will fail.Only a few changes were required to make it available via https, though this is an old express 2.5 application you should consider looking into: https://github.com/guille/chat-example.git