Skip to content

Commit

Permalink
Merge pull request #3 from rockhowse/master
Browse files Browse the repository at this point in the history
updated websocket to use origin for connectivity instead of localhost
  • Loading branch information
jsuarez5341 committed Mar 20, 2019
2 parents 010c6da + 824e3eb commit 91c4cda
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions comms.js
@@ -1,5 +1,6 @@
var ws = new WebSocket("ws://127.0.0.1:8080/ws");
//ws://127.0.0.1:8080
// Technique used from here:
// https://stackoverflow.com/questions/10406930/how-to-construct-a-websocket-uri-relative-to-the-page-uri
var ws = new WebSocket(((window.location.protocol === "https:") ? "wss://" : "ws://") + window.location.host + "/ws");
var inbox = [], outbox = [];

/*
Expand Down

0 comments on commit 91c4cda

Please sign in to comment.