title: Java socket program hosted on heroku cannot get InputStream
body: <p>I tried to upload my chat program to heroku, but client side couldn't get InputStream from server, so it stopped.
  What's problem in this? It worked well when I just try in localhost.
  It printed &quot;getting I/O stream&quot; but it seems like it stopped while getting InputStream.</p>
  <p>Also is it possible to get output from Server.jar?
  I cannot check if my program is working well.</p>
  <p>Server</p>
  <pre><code>server = new ServerSocket();
  server.bind(new InetSocketAddress(ip, port));
  System.out.println(&quot;server opened in &quot; + ip + &quot;:&quot; + port);
  
  try {
      while (server.isClosed() == false) {
          if (server.isClosed() == false) {
              Socket connection = server.accept();
              Client client = new Client(connection);
          }
      }
  } catch (Exception error) {
      if (server.isClosed() == false) {
          error.printStackTrace();
          shutdown();
      }
  }
  </code></pre>
  <p>Client</p>
  <pre><code>InetAddress[] dns = null;
  try {
      dns = InetAddress.getAllByName(&quot;jjabtu.herokuapp.com&quot;);
  } catch (UnknownHostException error) {
      System.out.println(&quot;No domain found&quot;);
  }
  
  Socket connection = new Socket(dns[0].getHostAddress(), 80);
  System.out.println(&quot;getting I/O stream&quot;);
  ObjectOutputStream output = new ObjectOutputStream(connection.getOutputStream());
  ObjectInputStream input = new ObjectInputStream(connection.getInputStream());
  System.out.println(&quot;got I/O stream&quot;);
  </code></pre>