fsockopen()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ditu
Forum Newbie
Posts: 7
Joined: Thu Apr 06, 2006 3:52 pm

fsockopen()

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

read the HTTP standard. It'll tell you exactly what to put.
ditu
Forum Newbie
Posts: 7
Joined: Thu Apr 06, 2006 3:52 pm

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

HTTP/1.1
HTTP/1.0

Read them. There will be a quiz later. :)
ditu
Forum Newbie
Posts: 7
Joined: Thu Apr 06, 2006 3:52 pm

Post 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.
Post Reply