For browser-to-browser connections, follow these steps:
All the following libraries −
<script src = "http://cdn.peerjs.com/0.3/peer.js"></script>
Create a peer −
To create a peer, you need to obtain a free API key.
var peer = new Peer('pick-an-id', {key: 'myapikey'});
Connection −
var conn = peer.connect('another-peers-id'); conn.on('open', function(){ conn.send('Welcome!'); });
The above is the detailed content of How do I implement a browser-to-browser (point-to-point) connection in HTML?. For more information, please follow other related articles on the PHP Chinese website!