How to connect a server through java socket when both the systems (Client and Server) have Firewall on?
<p>I am trying to connect my system (acting as Server) through Java socket from my friends system( acting as client). Both system (Mac OS) have firewall turn on. Below are the codes for Server and client:</p>

<p>Server:</p>

<pre><code>public static void main(String args[]) throws IOException {
    ServerSocket s = new ServerSocket(49884);
    System.out.println("Waiting for acceptance...");
    Socket s1 =s.accept(); 
    System.out.println("Accepted");
}
</code></pre>

<p>Client:</p>

<pre><code>public static void main(String args[]) throws IOException {
   Socket s1 = new Socket("10.13.12.78",49884);

}
</code></pre>

<p>It is working if I run both the programs on my system. But when I run the client program from another system the connection could not be able established and also there is no exception thrown, both the programs were in awaiting state.</p>

<p>Is it because of firewall is turn on? 
How can I confirm that it is because of firewall? 
If so, is there any technique to test the socket program as we do not have the permission to change the firewall settings?</p>

<p>Thanks in advance.</p>
