-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
42 lines (42 loc) · 1 KB
/
index.html
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
<html>
<head>
<title>Example Break</title>
<script src="break.js"></script>
<style>
textarea{
width: 75%;
height: 75%;
}
</style>
</head>
<body>
<textarea id="cmd">
var req = new BreakRequest("https://echo.websocket.org");
req.on('message', function(msg){
console.log(msg.data);
});
req.on('error', function(e){
console.error(e);
})
req.on('close', function(e){
console.warn("Server closed ! : "+e);
});
req.on('open', function(response){
if(response){
console.info(response); //JSON
}
alert("Connected: "+req.connected+" to "+req.correctURL);
req.send('Connection effectued');
});
//req.listen(3000);
req.connect();
</textarea>
<button onclick="javascript:test()">Run</button>
</body>
<script>
function test(){
let c = document.getElementById('cmd').value;
eval(c);
}
</script>
</html>