This is probably a very simple thing, but I can't figure it out as I'm relatively new to this. I have a server with an index.html page running great on nodejitsu. It works fine with no issues at all. However, I also have another node.js utilising socket.io-client. It's connecting fine and doing what I want it to do, but I'd like to incorporate an HTML page with it so I can control it with a click of a button. Essentially, I am trying to get my nodejitsu server page to refresh with a click of a button on my socket.io-client page. Here's the code on my client:
var io = require('socket.io-client'),
socket = io.connect('http://danturner81.server.jit.su', {port: 80});
socket.on('connect', function () { console.log("socket connected"); });
socket.on('disconnect', function () { console.log("socket disconnected"); });
socket.send('refreshScreen');
When I start this node via the terminal, it refreshes the page at danturner81.server.jit.su just fine. How would I incorporate this into a webpage with a button that executes the 'socket.send'?
Sorry if this appears dumb, but I really can't figure it out and I know I'm close to getting where I want!
Regards
Dan