title: Video chat application using socket over public Internet
body: <p>I am developing a Java Video chat application. I use Java socket to communicate. But it seems I have to set up the exact IP and Port to connect a socket server. My design is:</p>
  
  <ol>
  <li>Both client register report its ip to server and then server exchange their information.</li>
  <li>Choose one client(A) to be the video chat socket server and report its ip and port to server. Server will tell another client(B) his video chat server ip and port.</li>
  <li>Client B register itself to Client A. Now A and B can communicate directly.</li>
  </ol>
  
  <p>Here comes problem. If A has a public Internet IP, things work well. Problem is that if client A and B are both behind a router, for example client A and B are in different University, how can they communicate with socket?</p>