Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ http://localhost:8081

Connect to in VR app
```
new WebSocket(`ws://${window.location.hostname}:8081/`)
const remote = new WebSocket(`ws://${window.location.hostname}:8081/`)
remote.addEventListener('message', (e) => {
const data = JSON.parse(e.data);
});
```

### Socket Events
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ const fs = require('fs');
const path = require('path');

const port = 8081;
const indexFile = path.resolve(process.cwd(), './remote/index.html');
const jsFile = path.resolve(process.cwd(), './remote/dreamremote.js');
const indexFile = path.resolve(__dirname, './remote/index.html');
const jsFile = path.resolve(__dirname, './remote/dreamremote.js');
const clients = new Set();

const server = http.createServer((request, response)=>{
Expand Down