Skip to content

Commit

Permalink
Use document.domain to build WebSocket URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Esther Jun Kim committed May 28, 2016
1 parent fd65fc4 commit e25a77a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
9 changes: 0 additions & 9 deletions README.md
Expand Up @@ -113,15 +113,6 @@ If the download doesn't work, the release link may have changed. Check [here](ht

### Running the demo

#### Updating the WebSocket address

Modify `wsUrl` in `web/client/index.html`. The section of the code looks like this:

// CHANGE THIS TO THE APPROPRIATE WS ADDRESS
var wsUrl = 'ws://myedison.local:8084/';

Replace `myedison` with the name of your Edison.

#### Running the Node.js server

* Navigate to `web/server`.
Expand Down
5 changes: 1 addition & 4 deletions web/client/index.html
Expand Up @@ -30,17 +30,14 @@

<script src="/jsmpg.js"></script>
<script type="text/javascript">
// CHANGE THIS TO THE APPROPRIATE WS ADDRESS
var wsUrl = 'ws://myedison.local:8084/';

// Show loading notice
var canvas = document.getElementById('canvas-video');
var ctx = canvas.getContext('2d');
ctx.fillStyle = '#333';
ctx.fillText('Loading...', canvas.width/2-30, canvas.height/3);

// Start the player
var client = new WebSocket(wsUrl);
var client = new WebSocket('ws://' + document.domain + ':8084');
var player = new jsmpeg(client, { canvas:canvas });
</script>
</body>
Expand Down

0 comments on commit e25a77a

Please sign in to comment.