ソースを参照

Improving the Receive example

Making it clearer that the connection still needs to wait on the 'open' event, even when its the receiver.
fresheneesz 5 年 前
コミット
51ce4f0ab4
1 ファイル変更3 行追加0 行削除
  1. 3 0
      README.md

+ 3 - 0
README.md

@@ -41,6 +41,9 @@ peer.on('connection', (conn) => {
     // Will print 'hi!'
     console.log(data);
   });
+  conn.on('open', () => {
+    conn.send('hello!');
+  });
 });
 ```