From f0cdf1adc9dedc4be001d5c774658d2dfb1de659 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Tue, 22 Jan 2019 18:33:34 +0100 Subject: Added connecting --- public/scripts/main.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'public') 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) +}); -- cgit v1.2.3