You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
19
vendor/swoole/examples/websocket/client.html
vendored
Executable file
19
vendor/swoole/examples/websocket/client.html
vendored
Executable file
@ -0,0 +1,19 @@
|
||||
<script>
|
||||
var wsServer = 'ws://127.0.0.1:9501';
|
||||
var websocket = new WebSocket(wsServer);
|
||||
websocket.onopen = function (evt) {
|
||||
console.log("Connected to WebSocket server.");
|
||||
};
|
||||
|
||||
websocket.onclose = function (evt) {
|
||||
console.log("Disconnected");
|
||||
};
|
||||
|
||||
websocket.onmessage = function (evt) {
|
||||
console.log('Retrieved data from server: ' + evt.data);
|
||||
};
|
||||
|
||||
websocket.onerror = function (evt, e) {
|
||||
console.log('Error occured: ' + evt.data);
|
||||
};
|
||||
</script>
|
Reference in New Issue
Block a user