curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Connection refused - subdomain problem suspected

From: Richard G Elen via curl-library <curl-library_at_cool.haxx.se>
Date: Wed, 4 Sep 2019 23:45:04 +0100

Hello...

We're working with our developer to create a music royalty tracking
system for our internet radio station.

We use curl from PHP to pull in "now playing" metadata from our
streaming server's "streaminfo" URL.

During development, our developer used his own server to build the
system and all was well.

Now he has moved it over to a server we have commissioned from our
hosting company specifically for the purpose, this call no longer works,
and neither we (nor our hosting provider) can work out why. We would
appreciate some suggestions.

Our new database server has the hostname admin.ourstation.org ; our
streaming server we can call streams.ourstation.org (domain anonymized).

We're trying to pull in the data from
https://streams.ourstation.org:2199/rpc/ourstation/streaminfo.get. It
constantly returns "Failed to connect to streams.ourstation.org port
2199: Connection refused" - but only when accessed from our
admin.ourstation.org host. All other machines we can test from return
the data flawlessly.

We cannot access the command line on the new server ourselves, but our
hosting provider tells us that if they run it as a curl command it works
fine. I get a good result if I run a curl command from my desktop
machine also. Our developer has done the following:

1. Run a test call (similar to below) /from /admin.ourstation.org /to
/several other hosts and all work correctly
2. Run the test call below /from /several other hosts /to /return data
from streams.ourstation.org and all work correctly
3. Our developer and I can both return data from streams.ourstation.org
with manual curl calls from our desktop machines' command line.
4. Our developer has been able to recover data from
streams.ourstation.org from the prototype system on his own server from
the beginning (and still can).

ONLY the test from admin.ourstation.org to streams.ourstation.org fails.

We are therefore suspecting that there is a problem trying to return
data from a related subdomain and we wonder how to solve this issue. The
two servers are in different countries and the domain is managed by a
third party; the servers both have A Records pointed at them and resolve
suitably in a web browser, etc. The streams server has been running
happily for a couple of years with no known DNS issues.

We would be most grateful for any observations. Thanks in advance!

--Richard E

TEST CODE

<?php
header("Content-type: application/json; charset=utf-8");

         $url =
"https://streams.ourstation.org:2199/rpc/ourstation/streaminfo.get";

         $mysession = curl_init();
         curl_setopt($mysession, CURLOPT_URL, $url);
         curl_setopt($mysession, CURLOPT_RETURNTRANSFER, 1);
         curl_setopt($mysession, CURLOPT_CONNECTTIMEOUT , 10);
         curl_setopt($mysession, CURLOPT_FAILONERROR, true);
           $json = json_decode(curl_exec($mysession), true);

         if (curl_errno($mysession)) {
         echo "error: " . curl_error($mysession);
         }else{
         echo json_encode($json,JSON_PRETTY_PRINT);
         }

?>

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-09-05