Connecting to local NodeJS server from website

I am having trouble connecting to our local NodeJS server from a remote website that has a page which tries to connect to it using:

<script type="text/javascript" src="http://myipaddress:8101/socket.io/socket.io.js"></script>

But it just times out. The port is definitely open and can be accessed by online port checkers, there is also a rule in my firewall to allow anything on that port.

The server script is very basic for now:

var io = require('socket.io').listen(8101, {
'log level': 2,
'transports': ['websocket', 'flashsocket', 'htmlfile', 'xhr-polling', 'jsonp-polling'],
});

var mysql = require('mysql');
var dateFormat = require('dateformat');

var connection = mysql.createConnection({
host     : '127.0.0.1',
user     : 'NodeJS',
password : 'pass',
database : 'db'
});

var connectedClients = 0 ;
var connectedUserNames = {} ;
// listen on new connections
io.sockets.on('connection', function(socket) { // When someone connects...
socket.emit('Welcome!') ;
})

Where am I going wrong with this?


Tried:

<script>
var socket = io.connect('http://myip.com:8101');
socket.on('news', function (data) {
console.log(data);
socket.emit('my other event', { my: 'data' });
});
</script>

Which does not work as expected.