Skip to content

This repository demonstrates a simple WebRTC text chat application that runs entirely in the browser. Implemented with pure JavaScript and HTML, it allows real-time text communication between two browser tabs using WebRTC's DataChannels.

Notifications You must be signed in to change notification settings

soyharso/RTCExamples-Simple_WebRTC_signaling_ws

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

WebRTC Text Chat Example πŸŒπŸ’¬

This repository demonstrates a simple WebRTC text chat application that runs entirely in the browser. Implemented with pure JavaScript and HTML, it allows real-time text communication between two browser tabs using WebRTC's DataChannels.

Key Features ✨ Pure Browser Client: No plugins required - runs entirely in modern browsers

Direct Peer Connection: Text messages transmitted directly between browsers

Minimal Setup: Only requires Node.js for the signaling server

Zero Frameworks: Vanilla JavaScript implementation

Cross-Tab Communication: Test locally using two browser tabs

How It Works βš™οΈ Signaling: Clients connect via WebSocket (Node.js server) to exchange connection details

Peer Connection: Browsers establish direct WebRTC connection

Data Channel: Text messages are transmitted through a WebRTC DataChannel

Real-Time Chat: Messages appear instantly in both browser tabs

Setup Instructions πŸš€

  1. Start the Signaling Server bash npm install ws node servidor.js

  2. Open the Client Open index.html in two separate browser tabs

  3. Start Chatting Type messages in either tab to see them appear in both!

File Structure πŸ“‚ text β”œβ”€β”€ peer_webRTC.html # Client interface β”œβ”€β”€ servidor.js # WebSocket signaling server └── README.md # Documentation Technical Requirements πŸ”§ Node.js v14+ (for signaling server)

Modern browser (Chrome, Firefox, Edge)

WebRTC support enabled (default in modern browsers)

Ideal For Learning πŸŽ“ Perfect for understanding:

WebRTC peer connections

Signaling server implementation

DataChannel communication

Browser-to-browser networking

Note: For production use, additional security measures should be implemented. This demo is optimized for educational purposes and local testing.

About

This repository demonstrates a simple WebRTC text chat application that runs entirely in the browser. Implemented with pure JavaScript and HTML, it allows real-time text communication between two browser tabs using WebRTC's DataChannels.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors