title: java - can't make http request on port other than 80
body: <p>My java program is hitting <strong>"http://url:port"</strong> kind of url to fetch some data. On my local windows machine deployed on tomcat 6, it is working fine. But on production which is a linux machine having tomcat 6 on it, it gives me connection timeout. </p>
  
  <p>Ironically, if I hit the URL without port number, it will successfully bring me the output but not with port. Not finding any clue, please help. </p>
  
  <p>The snippet of code I am using to connect and fetch data is:</p>
  
  <pre><code>HttpClient httpclient = new DefaultHttpClient();
  HttpGet httpget = new HttpGet("59.162.167.36:80/api/…");
  httpget.setHeader("User-Agent", "UserAgent: Mozilla/5.0");
  HttpResponse response = httpclient.execute(httpget);
  HttpEntity entity = response.getEntity();
  </code></pre>