I am running this all on a vps which had a clean install of the latest centos. all the web server guff is all working fine and dandy, but I cannot find a huge amount of info on using node.js and socket.io from a vps on a website.
I followed these 2 guides (serverfault to do node.js and the other for the rest) changing bits to use updated files.
http://serverfault.com/questions/299288 ... -on-centos
http://spiritconsulting.com.ar/fedex/20 ... socket-io/
Then remembering Halls made an install vid, I went and watched them and followed the directions in video 7 (node.js / socket.io vid 2) and moved all the relevant files into the web directory.
My problem now is that I am getting the following error in the error console of the web browser. Uncaught ReferenceError: require is not defined
I got no clue what is going wrong, I have tried all the bits i can find on the net with no success...
If anyone has ANY clue on what is going on please let me know.
The index page...
Code: Select all
<html>
<head>
<script src="http://domain.net:80/domains/test/socket.io/socket.io.js"></script>
<script>
var http = require( 'http' );
var server = http.createServer( function( req, res ) {
//http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
res.writeHead( 200, { 'content-type': 'text/plain' });
res.end( 'Hello World!' );
});
server.listen( 8080 );
</script>
</head>
<body>
</body>
</html>
im new to vps stuff and my boss dont know anything about node.js and socket.io so is not much help at this point lol
ta x