Skip to content

Latest commit

Β 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ₯ WebRTC 1-to-1 Video Chat App

This project is a WebRTC demo built with React (frontend) and Node/Express + Socket.IO (backend).
It allows two users to connect over video/audio using peer-to-peer WebRTC connections.


✨ Features

  • πŸ”— Automatic matchmaking (pairs 2 users together).
  • 🎀 Mute/unmute microphone.
  • πŸ“· Toggle camera on/off.
  • πŸ‘‹ Leave room with proper cleanup.
  • 🌐 Uses Google STUN server for NAT traversal.

πŸš€ Getting Started

  1. Clone the repo and enter the folder

  2. Install dependencies

cd frontend npm install

cd backend npm install

  1. Compile TypeScript

⚠️ After any change in frontend or backend code, you must recompile:

cd frontend tsc cd backend tsc

  1. Run the backend cd backend node dist/index.js

  2. Run the frontend

BEFORE RUNNING THE FRONTEND FOLLOW THE PORT FORWARDING STEPS TO SET IT UP

cd frontend npm run dev

πŸ”‘ VS Code Remote / Port Forwarding Setup

Since WebRTC uses your camera/mic, you cannot test both peers on localhost. Instead, use VS Code’s port forwarding:

Forward port 3000 (backend) β†’ set to public visibility.

Forward port 5173 (frontend) β†’ set to public visibility.

Now you’ll have two public URLs:

Example:

Backend β†’ https://3000-yourid.devtunnel.something.ms/

Frontend β†’ https://5173-yourid.devtunnel.something.ms

βš™οΈ Configuration (Important!)

Open Room.tsx in the frontend.

Set the backend URL to the public 3000 URL:

const URL = "https://3000-yourid.devtunnel.something.ms/";

Save the file.

Run tsc again in the frontend. and now run npm run dev in frontend file

πŸ§ͺ How to Use

Open the 5173 public URL in one browser/device.

Share that 5173 URL with another person.

Both will connect β†’ backend (via 3000 public URL) pairs them β†’ WebRTC starts.

Use Mute/Unmute, Camera On/Off, or Leave Room buttons to control the session.

🧩 Notes

Works only 1-to-1 (no group calls).

Requires TURN servers for strict NAT/firewall scenarios (not included).

Must always re-run tsc after changes before starting servers.

also might not work sometimes, but might work. i mean it worked for me. ALSO if you see both peers are waiting to connect. both shall disconnect and then try to reconnect one at a time.

About

some sort of omegle

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages