title: Android Volley JsonObjectRequest times out, but explicit IP:port request works
body: <p>I have a REST API in go on my server VM, with gorilla/mux:</p>
  <pre class="lang-golang prettyprint-override"><code>router := mux.NewRouter().StrictSlash(true)
  log.Fatal(http.ListenAndServe(&quot;:49186&quot;, router))
  </code></pre>
  <p>I have an exposed IP and the domain forwarding set up on Godaddy as:
  [http://], [198.123.123.123:49186], Forward Type: Permanent (301), Settings: Forward Only</p>
  <p>In my Kotlin I have:</p>
  <pre class="lang-kotlin prettyprint-override"><code>val url = &quot;http://example.com/getJSONitem/item%20name&quot;
  val q = Volley.newRequestQueue(this)
  val request = JsonObjectRequest(Request.Method.Get, url, null, Response.Listener&lt;JSONObject&gt; { response -&gt;
      textView.text = response.getString(&quot;Name&quot;)
      },
      Response.ErrorListener { error -&gt;
          println(error)
  })
  q.add(request)
  
  </code></pre>
  <p>When I run this it hangs for a second and I get</p>
  <pre><code>I/System.out: com.android.volley.TimeoutError
  </code></pre>
  <p>BUT if I put the IP and port explicitly...</p>
  <pre><code>url = &quot;http://198.123.123.123:49186/getJSONitem/item%20name&quot;
  </code></pre>
  <p>...it works and I get my JSON object... At least that tells me that my server is listening. So it is either an issue with my Volley code or I have my DNS forwarding misconfigured, in which case this belongs on SE and I apologize. Thank you for reading.</p>
  <p>P.S. I have also tried putting the port after the domain as follows, and receive the same timeout error. Posting this question on server fault reinforces my theory that it is an issue with Volley.</p>
  <pre><code>url = &quot;http://example.com:49186/getJSONitem/item%20name&quot;
  </code></pre>