Alright, so I made simple node.js site, and when people connect to it, it loads the HTML immediately, but it takes them 10 seconds to connect to the server.
HTML -
<!DOCTYPE html>
<html>
<head>
<title>TEST SITE</title>
<script src="socket.io/socket.io.js"></script>
<script src="script.js" type="text/javascript"></script>
</head>
<body>
</body>
</html>
JS Client Script -
var socket = io.connect('http://localhost.aws.af.cm/');
socket.on('connect', function() {
alert('Connected');
});
Node.js Server Script -
/* Basics */
var express = require('express'),
app = express(),
server = require('http').createServer(app),
io = require('socket.io').listen(server);
server.listen(process.env.VMC_APP_PORT || 1337, null);
// routing
app.get('/', function (req, res) {
res.sendfile("index.html");
app.use(express.static(__dirname));
});
Site URL - http://localhost.aws.af.cm/
Any help or ideas? Thanks in Advance ;)
EDIT: THE SERVER IS DEPLOYED IN APPFOG