Page 1 of 1

fsockopen()

Posted: Sat Apr 08, 2006 11:41 am
by ditu
my dedicated server's Windows Media Service listens to 127.0.0.1:8800.
how can i modify the code below to point the publishing point "alpha"?

I don't want the client to get the exact location of my media server.
Please help me!

Code: Select all

<?php 
$domain = "127.0.0.1"; 
$ip = gethostbyname($domain); 

$fp = fsockopen($ip, 8800, $err1, $err2, 5); 
if(!$fp){
print "Unable to open";
}
if($fp){ 
   fputs($fp, "GET /????? HTTP/1.0\r\nHost: $domain\r\n\r\n");
} 
?>
the media server should listen to http://127.0.0.1:8800/alpha

Posted: Sat Apr 08, 2006 2:09 pm
by feyd
read the HTTP standard. It'll tell you exactly what to put.

Posted: Sat Apr 08, 2006 3:35 pm
by ditu
feyd wrote:read the HTTP standard. It'll tell you exactly what to put.
Am i doing the right thing?

Would be grateful if you could clarify the http standard bit to me.

thanks a million

Posted: Sat Apr 08, 2006 3:41 pm
by feyd
HTTP/1.1
HTTP/1.0

Read them. There will be a quiz later. :)

Posted: Sat Apr 08, 2006 3:56 pm
by ditu
:arrow: goal of HTTP/1.1 is to support the wide diversity of configurations
already deployed while introducing protocol constructs that meet the
needs of those who build web applications that require high
reliability and, failing that, at least reliable indications of
failure.

:arrow: HTTP/1.0 request and response structures onto the transport data units of the protocol in question is outside the scope of this specification.