View Single Post
Old 22nd August 2009, 00:39   #9
bored_womble
Winamp's Womble
 
bored_womble's Avatar
 
Join Date: May 2004
Location: Wimbledon Common
Posts: 1,088
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$data8192 );
$data=~s/ICY 200 OK//g;
print $data;

while (
1) { sysread $lsn$data8192 ); print $data; } 

Without open minds the world will die. Open yours and correct the mistakes you are making right now.

Last edited by bored_womble; 22nd August 2009 at 01:36.
bored_womble is offline   Reply With Quote