Anders and Briegel in Python
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
417B

  1. function poll() {
  2. var ws = new WebSocket("ws://localhost:5001");
  3. ws.onopen = function()
  4. {
  5. console.log("Connected to server.");
  6. };
  7. ws.onmessage = function (evt)
  8. {
  9. var received_msg = evt.data;
  10. console.log("Message received: " + evt.data);
  11. };
  12. ws.onclose = function()
  13. {
  14. console.log("Connection was closed.");
  15. };
  16. }
  17. window.onload = poll;