|
|
|
|
#1 | |
|
Junior Member
Join Date: Oct 2006
Posts: 7
|
Unable to retrieve data from DNAS-page
I'm trying to retrieve data from the SHOUTcast D.N.A.S. Status page with php, but it just won't work.
I'm perfectly able to see the page with my browser, but in php it fails to open. My own work fails as well as all kind of solutions found here or on the web. One of those solutions found on the web was this: http://devshed.excudo.net/scripts/ph...houtcast+class At the bottom of this page you can fill in a host and port for testing and when i fill in here my own host and port it shows up perfectly on that site. (So it is posssible! Very frustrating to know) But when I use the code i get: Connection refused (111) I also tried to use Java to retrieve info from the status page, but i get the message: Quote:
This is the java code i used: code: As mentioned above, my ip is 85.146.36.192 and shoutcast is running on port 8000... Has anyone a proper php code to retrieve the server-information? |
|
|
|
|
|
|
#2 |
|
Forum King
|
Pass a User-Agent field that begins with Mozilla, otherwise, it will be treated as an audio player
| Brought to you by ^V ^C | The one... the original... no seriously! |
|
|
|
|
|
#3 | |
|
Junior Member
Join Date: Oct 2006
Posts: 7
|
Quote:
Do you've got an code-example? I would be most gratefull... |
|
|
|
|
|
|
#4 | |
|
Junior Member
Join Date: Oct 2006
Posts: 7
|
Quote:
PHP Code:
Connection refused (111) Cannot retrieve 85.146.36.192 So it never come's to the part with the useragent-thing, because the PHP Code:
What am I doing wrong? |
|
|
|
|
|
|
#5 |
|
Forum King
Join Date: Aug 2004
Location: Hollis, Queens/The Bronx, NYC
Posts: 3,555
|
PHP Code:
or just fix the fputs(): PHP Code:
PHP Code:
*add :: I just checked your DNAS - there is no source, but the server is running -- in this "state," listen requests are refused, so if the DNAS does not see the User-Agent header, your script is a listener. /* v2 HTML5 / Player test pages DigitalMixNYC, DigitalMixNYCbx | DNAS Status: Now Playing js codes (scaststatus_X.php) | PortForward.com | Upload/Download Speed Test | No-IP.com: Free Dynamic DNS | In the YP | dnasDir */ |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Nov 2006
Location: Denver, CO
Posts: 10
|
While writing ShoutCONTROL I figured this to be the easiest way of doing things:
PHP Code:
AIM: BMProtocol if you need any more help! |
|
|
|
|
|
#7 | ||
|
Junior Member
Join Date: Oct 2006
Posts: 7
|
Quote:
When I use: $scp = @fsockopen($data['host'],$data['port'], &$errno, &$errstr, 30); or any other code to retrieve data from the server, it fails. So that fputs-line will never work since $scp (or $fp in the other example) is not properly initialized. Quote:
|
||
|
|
|
|
|
#8 |
|
Forum King
Join Date: Aug 2004
Location: Hollis, Queens/The Bronx, NYC
Posts: 3,555
|
Maybe something else is wrong:
This link should work for you: http://85.146.36.192:8000/index.html Where is the PHP host in relation to the DNAS? and where is the DNAS? If both are behind a residential broadband router/modem, you may not be able to access the public IP from the LAN, and would have to use the LAN IP of the DNAS server in your PHP. Most mass-hosted PHP does not allow remote sockets and other file functions because they can expose the underlying hosts files -- fopen() fsockopen(), etc will silently fail. Regardless, create and upload a simple PHP to your host to get the info you need [name it phpinfo.php] to debug this kind of issue: PHP Code:
* suppressing errors and warnings with "@" is hiding information that may also be useful. /* v2 HTML5 / Player test pages DigitalMixNYC, DigitalMixNYCbx | DNAS Status: Now Playing js codes (scaststatus_X.php) | PortForward.com | Upload/Download Speed Test | No-IP.com: Free Dynamic DNS | In the YP | dnasDir */ |
|
|
|
|
|
#9 | |||
|
Junior Member
Join Date: Oct 2006
Posts: 7
|
thnx for your reply again.
Quote:
Quote:
I also tried to get the data with Java, that I execute from my own computer. Quote:
http://www.flinkfout.nl/phpinfo.php i believe nothing is disabled.. |
|||
|
|
|
|
|
#10 | |
|
Junior Member
Join Date: Oct 2006
Posts: 7
|
Re: Unable to retrieve data from DNAS-page
Quote:
So the problem must be my hosting service? But why is it that only the fsockopen statement fails with the DNAS-server? Because it is possible for me to use the fsochopen command on other page's like yahoo or something... And could there a workaround for me to still be able to retrieve data from my DNAS server? |
|
|
|
|
|
|
#11 |
|
Forum King
Join Date: Aug 2004
Location: Hollis, Queens/The Bronx, NYC
Posts: 3,555
|
Maybe only outbound HTTP on port 80 is allowed by your PHP host, or only connections to certain domain names -- you could try fopen({url}), but read up on it first, it is typically disallowed as well.
At this point you can either set up your own HTTPd at home and run PHP yourself or get the specific details of your hosting with regards to PHP -- beware that many that allow PHP will not allow you to make remote connections because thats exactly how worms are made, and you can get the whole hosting company blacklisted. /* v2 HTML5 / Player test pages DigitalMixNYC, DigitalMixNYCbx | DNAS Status: Now Playing js codes (scaststatus_X.php) | PortForward.com | Upload/Download Speed Test | No-IP.com: Free Dynamic DNS | In the YP | dnasDir */ |
|
|
|
|
|
#12 |
|
Junior Member
Join Date: Oct 2006
Posts: 7
|
Excellent! Thanks a lot for your help.
I just changed the port from 8000 to 80 (isn't used anyway) and it works like a charm! No need to set up a host myself, or contact my hosting company... Thanks again! |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|