title: cURL connection refused
body: <p>I'm trying to simply read the Philips Hue lights information from my home with the following code:</p>
  
  <pre><code>$fp = fopen(dirname(__FILE__).'/errorlog.txt', 'a');
  
  $ch = curl_init();
  curl_setopt_array($ch, array(
      CURLOPT_RETURNTRANSFER =&gt; 1,
      CURLOPT_URL =&gt; 'http://119.119.20.20:2827/api/Js82jH2lao-pAiws89S9A-k9hHsukw72/lights',
      CURLOPT_VERBOSE =&gt; true,
      CURLOPT_STDERR =&gt; $fp
  ));
  $resp = curl_exec($ch);
  curl_close($ch);
  print_r($resp);
  </code></pre>
  
  <p>It returns nothing. Looking at errorlog.txt it says:</p>
  
  <pre><code>* About to connect() to 119.119.20.20 port 2827 (#0)
  *   Trying 119.119.20.20... * Connection refused
  * couldn't connect to host
  * Closing connection #0
  </code></pre>
  
  <p>I'm able to read the data and change light settings through a site like <a href="https://www.hurl.it/" rel="nofollow noreferrer">hurl.it</a> which tells me I've setup my router correctly. <code>allow_url_fopen</code> on my server is on. I'm using curl because I want to do a PUT request as well. I don't want to use a library for simply turning on and off an light.</p>
  
  <p>How can I make this work?</p>
  
  <p><strong>Edit to clarify:</strong> I'm using an external server to host the php, which communicates to my Philips Hue bridge at home. You can assume I forwarded my port correctly. No VPN.</p>