This project is a basic implementation of a WebRTC video chat application using Django Channels for signaling. It allows multiple peers to join a room, establish video connections, and communicate via data channels.
- Multi-peer video chat
- Real-time data channels
- ICE candidate exchange
- Basic logging for debugging
- Python 3.7+
- Django 3.1+
- Django Channels 3.0+
- Redis (for WebSocket backend)
- Bootstrap (for frontend design)
-
Clone the repository:
git clone https://github.com/hrsh-hp/PrivateHub.git cd PrivateHub
-
Set up a virtual environment and install Python dependencies:
python -m venv venv venv\Scripts\activate pip install -r requirements.txt
-
Install Redis:
Download and install Redis from Install redis on Windows.
Start the Redis server:
redis-server
-
Set up Django:
python manage.py migrate python manage.py createsuperuser python manage.py runserver
-
Clone the repository:
git clone https://github.com/hrsh-hp/PrivateHub.git cd PrivateHub
-
Set up a virtual environment and install Python dependencies:
python3 -m venv venv source venv/bin/activate pip install -r requirements.txt
-
Install Redis:
sudo apt update sudo apt install redis-server
Start the Redis server:
sudo service redis-server start
-
Set up Django:
python manage.py migrate python manage.py createsuperuser python manage.py runserver
-
Run the Django development server:
python manage.py runserver
-
Access the application:
Open your web browser and navigate to
http://localhost:8000
. -
Join the chat room:
- Enter a username and click the "Join" button.
- Allow access to your camera and microphone.
- You should see your video feed on the page.
-
Invite another peer:
- Open another browser window or tab.
- Enter a different username and join the same room.
- You should see both video feeds in each window.
-
WebSocket connection errors:
- Check if the WebSocket server is running.
- Ensure the correct WebSocket URL (ws:// or wss:// based on your setup).
-
SDP offer/answer not exchanged:
- Verify that SDP messages are being sent and received correctly.
- Check the WebSocket logs for any errors.
-
ICE candidate issues:
- Ensure that ICE candidates are being gathered and sent.
- Check network conditions and ensure STUN/TURN servers are reachable.
-
No video stream:
- Ensure that media permissions are granted in the browser.
- Check if the video elements are correctly assigned media streams.
Extensive logging is added throughout the code to assist in debugging. Check the browser console and server logs for detailed information.
If you'd like to contribute to this project, please fork the repository and use a feature branch. Pull requests are warmly welcome. And if you like my work don't hesitate to give a star 🌟.