This project implements a Peer-to-Peer (P2P) video streaming application in Java using a custom overlay network simulated with Docker. It demonstrates traffic routing between isolated subnets, video synchronization, and GUI integration using VLCJ.
- P2P Video Streaming: Peers can stream video content to each other via RTSP/TCP.
- Overlay Network: Simulates a realistic topology with 3 distinct subnets (
172.20.x,172.21.x,172.22.x) and a central software router. - Custom Routing: Automated
ip routeconfiguration allows communication across isolated Docker networks. - GUI in Docker: Java Swing interface running inside containers, forwarded to the host machine via X11.
To run this project, you need the following dependencies. The required JAR files are included in the lib/ folder:
- Java 17 (Eclipse Temurin)
- Docker & Docker Compose
- VLCJ Libraries (Found in
lib/):vlcj-4.7.1.jarvlcj-natives-4.1.0.jarjna-5.8.0.jarjna-platform-5.8.0.jar
Note: These libraries are essential for the application to interface with the VLC media player installed inside the Docker container.
If P2PVideoApp.jar is not in the root directory:
- Export the project as a Runnable JAR from Eclipse or IntelliJ.
- Name it
P2PVideoApp.jar. - Place it in the root folder (next to
Dockerfile).
Since the app has a GUI running inside Docker, you need an X Server to see it.
- Install VcXsrv.
- Run XLaunch with these settings:
- Display number:
0 - Extra settings: Check "Disable access control" (Crucial step!).
- Display number:
- The
docker-compose.ymlis already configured to useDISPLAY=host.docker.internal:0.0.
Open a terminal in the project folder and run:
docker-compose up --build