-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
70 lines (54 loc) · 2.08 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="ja" />
<meta http-equiv="X-UA-Compatible" content="chrome=1; IE=8; IE=edge" />
<title>node.js / socket.io SSL接続サンプル</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="/socket.io/socket.io.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var socket = io.connect('https://home.thestargazer.net');
var Message_Windows=$("#msg_wrap");
var CPU_Info_Container=$("#CPU_Info_Wrap")
socket.on('connect', function () {
Message_Windows.prepend( new Date().toString() + '<span>接続できたぞ</span><br>');
});
socket.on('message', function(message) {
Message_Windows.prepend(new Date().toString() + '<span>' + message + '</span><br>' );
});
socket.on('anything', function(message) {
Message_Windows.prepend(new Date().toString() + '<span>' + message + '</span><br>' );
});
socket.on('system info',function(cpu_info){
CPU_Info_Container.text(cpu_info);
//Message_Windows.prepend('<span>' + cpu_info + '</span><br>');
});
$("#sent").click(function(){
socket.emit("private message","Guest",$("#msgbox").val());
})
})
</script>
<style type="text/css">
body {
background-color: black;
font-size : 12px;
color : gray;
line-height : 40px; }
body > span {
color : lightgray;
font-size : 24px;
margin-left : 10px; }
body > span:first-child {
color : #feb2ad; }
</style>
</head>
<body>
<div id="CPU_Info_Wrap">
</div>
<input type="test" id="msgbox" style="width:200dx;"/><input type="button" id="sent"/>
<div id="msg_wrap"></div>
</body>
</html>