Quote:
Originally posted by dave19
check this url:
s6.mediastreaming.it/cgi-bin/listen.pls?7110
they have the shoutcast server running on port 7110, but with that link you can receive the audio from port 80.
I think it's not a php script, maybe a perl program.
|
you can achieve the same thing in perl using the below
PHP Code:
#!/usr/bin/perl
use strict;
use IO::Socket::INET;
my $ip="a.b.c.d";
my $port="port";
my $lsn = IO::Socket::INET->new
(
PeerAddr => $ip,
PeerPort => $port,
ReuseAddr => 1,
Proto => 'tcp',
Timeout => 5
);
if (!$lsn) { print "Cannot connect to '$ip' port '$port'.\n"; exit(0); }
my $data;
my $header ="GET / HTTP/1.0\r\n";
$header.="Accept: */*\r\n";
$header.="User-Agent: Bored_Womble Proxy Script\r\n";
$header.="\n\n";
syswrite ( $lsn, $header );
sysread ( $lsn, $data, 8192 );
$data=~s/ICY 200 OK//g;
print $data;
while (1) { sysread ( $lsn, $data, 8192 ); print $data; }