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
432B

  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 new_state = JSON.parse(evt.data);
  10. vops = new_state.vops;
  11. ngbh = new_state.ngbh;
  12. updateScene();
  13. };
  14. ws.onclose = function()
  15. {
  16. console.log("Connection was closed.");
  17. };
  18. }