Thread: scproxy+auth
View Single Post
Old 10th January 2004, 15:26   #7
Major Dude
Join Date: Aug 2003
Posts: 942
To quote from the link to the manual you sent me

In PHP 4.2.0 and later, the default value for the PHP directive register_globals is off. This is a major change in PHP. Having register_globals off affects the set of predefined variables available in the global scope. For example, to get DOCUMENT_ROOT you'll use $_SERVER['DOCUMENT_ROOT'] instead of $DOCUMENT_ROOT, or $_GET['id'] from the URL instead of $id, or $_ENV['HOME'] instead of $HOME.
The scproxy+auth PHP script written by Tom Pepper repeatedly uses the variables $PHP_AUTH_USER and $PHP_AUTH_PW which are actually members of the $_SERVER array of predefined superglobal variables. The register_globals directive autmatically creates global variables for each of the predefined variables in the superglobal arrays. As it is switched off by default in PHP 4.2 to make the script work you either have to turn it on (which has security implications) or you have to change all references to $PHP_AUTH_USER into $_SERVER['PHP_AUTH_USER']. Which is what i have done in the script i posted.

My problem is now that the authorisastion part of the script works fine, it's just the proxy bit doesn't work. Winamp seems to be connecting but just stays inm the connecting phase for about 20 secs then says error syncing to mpeg and reconnects. In mt DNAS log it says there is a connection being made and when winamp trys to connect again the log registers a second copnnection. This continues untill all of my listener slots are full.

Hasw anyone got this script to work. Can anyone see if the changes i have made to the script in order to make mthe authentication work have in fact broken the proxy part.

I have also now discovered that if i kick the connection that winamp is trying to make before it times out it then play the stream back for the amount of time it was trying to connect. E.g. if it says connecting for 15 secs and i then kick it before it times out i then get 15 secs of music[/edit]

Thanks for any and all input.

Do not PM me for tech support !

Last edited by jackherer; 10th January 2004 at 16:49.
jackherer is offline   Reply With Quote