SHARE
TWEET

Untitled

a guest Mar 21st, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.   <meta charset="utf-8">
  5.   <meta name="viewport" content="width=device-width">
  6.   <title>JS Bin</title>
  7. </head>
  8. <body>
  9.  
  10. <script id="jsbin-javascript">
  11. var ws = new WebSocket("wss://yejiaxi.cn:8080");
  12.  
  13. ws.onopen = function(evt) {
  14.   console.log("Connection open ...");
  15.   ws.send("Hello WebSockets!");
  16. };
  17.  
  18. ws.onmessage = function(evt) {
  19.   console.log( "Received Message: " + evt.data);
  20. };
  21. </script>
  22.  
  23.  
  24.  
  25. <script id="jsbin-source-javascript" type="text/javascript">var ws = new WebSocket("wss://yejiaxi.cn:8080");
  26.  
  27. ws.onopen = function(evt) {
  28.   console.log("Connection open ...");
  29.   ws.send("Hello WebSockets!");
  30. };
  31.  
  32. ws.onmessage = function(evt) {
  33.   console.log( "Received Message: " + evt.data);
  34. };</script></body>
  35. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top