- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can I make a browser to browser (peer to peer) connection in HTML?
For the browser to browser connection, follow the below-given steps −
All the following library −
<script src = "http://cdn.peerjs.com/0.3/peer.js"></script>
Create a peer −
For creating a peer, you need to get a free API key.
var peer = new Peer('pick-an-id', {key: 'myapikey'});
Connect −
var conn = peer.connect('another-peers-id'); conn.on('open', function(){ conn.send('Welcome!'); });
Advertisements