mining-pool/debug_scripts/socket_io.html
2017-03-05 16:00:35 -08:00

19 lines
No EOL
636 B
HTML

<html>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js"></script>
<script>
// set-up a connection between the client and the server
var socket = io.connect('http://ftb-infinity.snipanet.com:8001/');
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "pool_stats";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
});
socket.on('message', function(data) {
console.log('Incoming message:', data);
});
</script>
</html>