<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>socket</title>
</head>
<body>

<script>
var ws = new WebSocket("ws://192.168.1.8:1127");
ws.onopen = function() {
console.log("welcome");
//ws.send('{"type":1,"s":"","username":"joshua317","platform":"android", "version":"3.5.1"}');
};

ws.onmessage = function(evt) {
console.log(evt.data);
};

ws.onclose = function(evt) {
console.log("webSocketClosed!");
};

ws.onerror = function(evt) {
console.log("WebSocketError!");
};
</script>

</body>
</html>