diff options
author | Marvin Borner | 2019-01-22 18:33:34 +0100 |
---|---|---|
committer | Marvin Borner | 2019-01-22 18:33:34 +0100 |
commit | f0cdf1adc9dedc4be001d5c774658d2dfb1de659 (patch) | |
tree | d0238c0ea8582076ed9da391ed9af3fbdf31e5be /public | |
parent | 2769bc913d5a426954974f94a4245d5ae4f83faa (diff) |
Added connecting
Diffstat (limited to 'public')
-rw-r--r-- | public/scripts/main.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/public/scripts/main.js b/public/scripts/main.js index a9edca0..d732b97 100644 --- a/public/scripts/main.js +++ b/public/scripts/main.js @@ -1,4 +1,9 @@ const nanoid = require('nanoid'); -var peer = new Peer(nanoid(), {host: '127.0.0.1', port: 4242, path: '/'}); +const userId = nanoid(); +const peer = new Peer(userId, {host: '127.0.0.1', port: 4242, path: '/'}); + +peer.on('open', id => { + console.log('[LOG] Your ID is ' + id) +}); |