I have an application that run on port 443. It is in PHP. I then have a node.js application that runs on port 9999. I want to use sockets. But I got an error with cross domains. Here is the code:
index.php
$( document ).ready(function() {
var socket = io('https://mydomain.com:9999', {secure: true});
});
server.js
var io = require('socket.io')();
io.set('origins', 'https://mydomain.com');
console.log('origin set');
io.listen(9999);
io.on('connection', function (socket) {
socket.emit('ping', {message: 'Hello World!'});
});
In firebug I see the error message: Cross-origin request blocked.
What am I doing wrong? I cannot find much resource about the combination ssl and socket.io. Those few I found tell I should do more or less as in the code above.