Proove you can create a Peer to Peer connection without a signaling server.
Normally a signaling server is used to exchange connection information between two peers. Commonly done through a websocket. This project is proof of concept to create a peer to peer connection without a signaling server.
Currently there is a STUN server used to calculate the public internet address. If the peers are on the same network, the STUN server is not needed.
This project uses the WebRTC javascript implementation supported by most modern browsers. If you want to create a peer to peer connection without the use of a helper library then this may be a good place to start.
git clone [email protected]/popkinj/webrtc.git
cd webrtc
npm ci
npm run dev
- Open two browser windows to the testing server.
- Create and pass the connection information between page 1 and page 2.
- When a data connection is established, test sending messages between the two pages. Currently all messages are sent to the console.
- Instigator creates a QR-Code which contains a link to the testing server. The url will contain all the connection information of the Instigator.
- The responder scans the QR-Code and opens the link in the browser.
- The responder stores the connection information into Peer object.
- The instigator gets the signal through webrtc that the responder is ready to connect.
- The instigator's camera is turned on ready to scan the responders QR-Code.
- The responder creates a QR-Code which contains a link to the testing server. The url will contain all the connection information of the Responder.
- The instigator scans the QR-Code of the responder and saves the connection information into a Peer object.