Portal is a peer-to-peer video chat web application built with WebRTC and JavaScript.
Portal enables direct audio and video communication between browsers using WebRTC, with a lightweight signaling server to facilitate peer discovery.
This project is currently in progress and will continue to evolve based on feedback and new feature requests.
The primary goal of this project is to learn and demonstrate how to build a peer-to-peer web application using JavaScript and WebRTC.
- Real-time audio and video calling via WebRTC
- Unique peer identification (like a "phone number" for direct connections)
- Secure signaling server over WebSockets
- Self-signed SSL certificates for local HTTPS deployment (required by modern browsers for WebRTC)
- Frontend: React.js with Vite (served over HTTPS)
- Backend: Node.js server to serve the app over HTTPS
- Signaling: Secure WebSocket server (WSS) for peer matchmaking
- Node.js (v14 or later recommended)
- Clone the repository:
git clone https://github.com/ssnofall/portal.git
cd portal- Install Dependencies
npm install # Install Backend dependencies
cd client && npm install # Install React dependencies
cd ..- Create the required directories and files:
mkdir certs
touch .env- Generate SSL certificates (required for HTTPS):
cd certs
openssl req -nodes -new -x509 -keyout server.key -out server.cert -days 365- You can press Enter for most prompts to accept the defaults.
- For Common Name, enter your IP address or
localhost(e.g.,192.168.1.100orlocalhost).
- Configure your '.env' file. Replace the 'HOST' value with your machine's local IP address:
NODE_ENV=development
WEB_PORT=3000
SIGNALING_PORT=3001
HOST=192.168.1.100Development Mode:
# Start the signaling server (WSS)
npm run portal:signal
# Start the express web server that serves the webpage (HTTPS)
npm run portal:web
# Start the React development server on localhost
cd client
npm run react:devProduction Mode:
# Build the React app
cd client
npm run portal:build
cd ..
# Start servers
npm run portal:signal
npm run portal:webNote: HTTPS is enabled by default. Both the web server and signaling server use certificates from the certs/ directory. The React dev server (Vite) will also use HTTPS with the same certificates.
-
Contributions, bug reports, and feature requests are welcome!
-
Feel free to open an issue or submit a pull request.
This project is licensed under the GNU General Public License v3.0
