Kuangcp/JavaBase

View on GitHub
netty/src/main/java/netty/websocket/client/client.html

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>WeChat Client</title>
</head>
<body>
</body>

<script>
    var ws = new WebSocket("ws://localhost:1233/ws/mvc?userId=120");
    ws.onopen = function () {
        ws.send("hello");
    };

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

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

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

</html>