| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>ws test</title>
- <script src="data.js"></script>
- </head>
-
- <body>
- <script>
-
- function on_ws_msg(bin){
- var j = BIN.hdr.b2j(bin);
-
- j.chall = 1;
- j.type = PKT_TYPE.PKT_TYPE_CH_ALL;
-
- console.log(j);
- var b = BIN.hdr.j2b(j);
-
- console.log(b);
- ws.send(b);
-
- }
- function ws_hdr(){
- var proto = window.location.protocol,ws;
- if (proto == 'https:'){
- ws = 'wss://';
- }else{
- ws = 'ws://';
- }
- return ws;
- }
- ws = new WS("ws://192.168.234.132/ws",on_ws_msg);
-
-
-
- </script>
- </body>
- </html>
|