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.

23 lines
413B

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