Weblink is a browser-based chat application built on WebRTC, requiring no downloads and usable directly in your browser. It offers a serverless, P2P architecture with multiple backends, including Firebase and WebSocket. The application supports real-time text chat, file transfer, file storage, video calls, and multi-party communication through a mesh network. Advanced features include chunked and compressed file transfers for efficient and resumable large file sharing, multi-channel data transfer using multiple DataChannels for faster performance, and IndexedDB caching to minimize memory usage during transfers. End-to-end encryption ensures privacy and security with encrypted signaling messages.
This project is deployed on Vercel. Check it out at https://web1ink.vercel.app.
You can also use https://webl.ink which deployed on aliyun instead.
git clone https://github.com/99percentpeople/weblink.git
cd weblink
pnpm install
Make sure you configure the Firebase keys in the project (as shown below), then run the following command:
# Development
pnpm dev
# Build
pnpm build
You can deploy this project to Docker using docker-compose.yaml
, and it will automatically build the weblink-ws-server as backend.
Modify the docker-compose.yaml
file to set the correct environment variables. Then run the following command:
docker-compose up -d
To enable SSL you need to provide the SSL certificate cert.pem
and key key.pem
files in the docker/ssl
directory. And run the following command:
ENABLE_SSL=true docker-compose up -d
Alternatively, you can also use Dockerfile to deploy this project to Docker.
To deploy this project to Vercel, follow these steps:
-
Go to the Vercel website and log in (or create an account).
-
Connect your GitHub repository and select the cloned repository.
-
In your Vercel project settings, find "Environment Variables" and add the Firebase API key and other environment variables (as shown below).
-
Click the "Deploy" button, and Vercel will automatically build and deploy your project.
You will need to configure Firebase keys for both local development and deployment to Vercel. Add the following Firebase environment variables:
VITE_FIREBASE_API_KEY
VITE_FIREBASE_AUTH_DOMAIN
VITE_FIREBASE_PROJECT_ID
VITE_FIREBASE_STORAGE_BUCKET
VITE_FIREBASE_MESSAGING_SENDER_ID
VITE_FIREBASE_APP_ID
VITE_FIREBASE_DATABASE_URL
For Vercel deployment, set the environment variables by following these steps:
-
Open your Vercel project and go to "Settings."
-
Find "Environment Variables."
-
Add the Firebase configuration items above and input the corresponding values.
This application can deploy its own WEBSOCKET server, and a WEBSOCKET server is provided. You can choose to use it or not. For details, please refer to weblink-ws-server.
For local development, create a .env.local file and add the Firebase keys:
# backend choose FIREBASE or WEBSOCKET
# FIREBASE
VITE_BACKEND=FIREBASE
VITE_FIREBASE_API_KEY=your-firebase-api-key
VITE_FIREBASE_AUTH_DOMAIN=your-firebase-auth-domain
VITE_FIREBASE_PROJECT_ID=your-firebase-project-id
VITE_FIREBASE_STORAGE_BUCKET=your-firebase-storage-bucket
VITE_FIREBASE_MESSAGING_SENDER_ID=your-firebase-messaging-sender-id
VITE_FIREBASE_APP_ID=your-firebase-app-id
VITE_FIREBASE_DATABASE_URL=your-database-url
# WEBSOCKET
VITE_BACKEND=WEBSOCKET
VITE_WEBSOCKET_URL=your-websocket-url
If you are using P2P connections outside a local area network (in a NAT environment), you may need to configure a TURN server to ensure connections are established. In the settings page, you can configure the TURN server with the following format:
TURN Configuration Format:
turn:turn1.example.com:3478|user1|pass1|longterm
turns:turn2.example.com:5349|user2|pass2|hmac
The application currently supports LAN use in non-secure environments. Ensure that your devices are in the same LAN and the firewall does not block P2P connections.
And at the same time, run weblink-ws-server to support WEBSOCKET connections.
Contributions are welcome! Please feel free to submit issues or pull requests.
This project is open-sourced under the MIT License.