Repository navigation
Expand file tree
/
Copy pathloady.html
More file actions
52 lines (43 loc) · 1.61 KB
/
Copy pathloady.html
File metadata and controls
52 lines (43 loc) · 1.61 KB
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
<!doctype html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://turted.karopapier.de/socket.io/socket.io.js"></script>
<link href="style.css" rel="stylesheet">
<script src="TURTED.js" type="text/javascript"></script>
</head>
<body lang="en">
<h3>TURTED Server load creator</h3>
<p>The purpose of this demo is to create a lot of connections to a server by connecting, joinging channels and sending
echo requests</p>
<form id="restpost" action="?#">
Server: <input type="url" id="host" placeholder="http://turted.example.com/"><br>
Number of clients:
<input type="number" id="num_clients" value="10" placeholder="number of clients to simulate"><br/>
Number of channels to join: <input type="number" id="num_channels" value="3"><br/>
<input type="button" value="Start" id="start" style="height: 150px; width: 150px; font-size: 20pt">
</form>
<script type="text/javascript">
function gid(id) {
return document.getElementById(id);
}
$('#start').on("click", function () {
var num_clients = parseInt(gid("num_clients").value);
var num_channels = parseInt(gid("num_channels").value);
var host = gid("host").value;
if (!host) {
alert("Enter host");
return;
}
console.log("Starting client", c);
var clients = [];
for (var c = 0; c < num_channels; c++) {
var t = new TURTED(host);
t.ident({"username": "loady" + c});
t.join("channel" + c);
clients[c] = t;
}
});
</script>
</body>
</html>