I have a sparkjava server. So this is set up on-top of the jetty server. I want to make a video chat using WebRTC. I want to negotiate a connection between client A and client B. After they connect I want to take my server out of the middle. (I want data to transfer P2P). I have read alot on hole punching but It doesnt seem like a reliable solution. Is there any code or tutorial that could help me along the way? I saw a similar question here Java: Using server to create P2P between two clients But the answer is a little to vague for me to understand. For assumptions, I have a working web server and the clients are running chrome or any modern browser that doesn't use ActiveX
Asked
Active
Viewed 358 times
0
-
The question is how are you going to establish a P2P connection of client A and B if they are not on the same network? You will have to somehow expose your router IP to the net, then somehow accept the inbound request from a different client and vis-versa. I do not know how to do this personally, maybe there is something on you router which you can configure to allow such connections. – Potato Oct 04 '18 at 21:29
-
Exposing the public IP address of each client is simple. Also I can configure the routers just fine. My problem is when trying to do the same thing in an internet environment. I cant expect every person who wants to use this web service to set up port forwarding – caleb baker Oct 05 '18 at 19:25
-
So I found out you can do something known as port forwarding and Nat traversal, I have personally haven't tried to do this myself, link https://stackoverflow.com/questions/28657559/c-sockets-communication-between-pcs-over-internet – Potato Oct 05 '18 at 21:27
1 Answers
0
So for any just looking at this. the main thing that I was missing was a signaling server. webRTC takes care of most of the other stuff. I found some good tutorials on creating signaling servers in java so that will be the direction that I head

caleb baker
- 144
- 7