-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmontestenodebroadcasting.php
53 lines (45 loc) · 1.5 KB
/
montestenodebroadcasting.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/*
try
$db = new Mongo("mongodb://kolabNX:eV30N.lmDXWzlVZydUwEVIGO6k7Dq0nSO48LwnVS1SM-@ds031088.mongolab.com:31088/kolabNX");
$registrations = $db->selectCollection('kolabNX', 'users');
if(isset($registrations)){
echo 'ca marche machine '.$_SERVER['SERVER_ADDR'].' <br/>';
print_r($registrations);
}
} catch (Exception $e){
echo 'Caught exception: '.$_SERVER['SERVER_ADDR'].' ', $e->getMessage(), "";
}
*/
?>
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<meta charset="UTF-8">
<title>Load Balancing in two levels (PHP and Node.js)</title>
<script type="text/javascript">
function sendSomething(){
var tesxte=document.getElementById('sendtest').value;
if(tesxte!=='' && tesxte!==' '){
layoutSocket.emit('newuser',tesxte);
}
}
</script>
</head>
<body>
<script src='http://usnxe.cloudapp.net:2424/socket.io/socket.io.js'></script>
<script type="text/javascript">
layoutSocket= io.connect('http://usnxe.cloudapp.net:2424/kolabPlatform');
layoutSocket.on('loadbalancing',function(doc){
console.log(doc);
});
</script>
<br/>
<label>Type something</label><input name="Type something" type="text" id="sendtest"/> <input name="Send" value="Send" type="button" onclick="sendSomething();"/>
</body>
</html>