This commit is contained in:
MeSHard
2025-11-10 16:12:07 +08:00
parent 99f88bc53e
commit 94f7e83679
181 changed files with 15770 additions and 0 deletions

1
view/README.md Normal file
View File

@@ -0,0 +1 @@
如果不使用模板,可以删除该目录

38
view/Test.php Normal file
View File

@@ -0,0 +1,38 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
</body>
<script>
let ws = new WebSocket("ws://127.0.0.1:2346")
ws.onopen = function() {
console.log("连接成功");
//每30秒发送一次心跳
setInterval(function(){
ws.send(JSON.stringify({'type':"peng"}));
console.log('发送心跳...');
},30000)
};
ws.onmessage = function(evt) {
data = JSON.parse(evt.data)
console.log(data);
};
ws.onclose = function(evt) {
console.log("连接已关闭");
};
</script>
</html>