<pre><?
include("socksed.php");
$socksed = new socksed;
/*
* Adding SOCKS server to chain
*
* The format is version://username:password@hostname:port
*/
$socksed->chain[] = "socks4://127.0.0.1:1080";
$socksed->chain[] = "socks4a://example.net:1234";
$socksed->chain[] = "socks5://[2001:0db8:0000:0000:0000:ff00:0042:8329]:12891";
/*
* Build a HTTP request
*/
$request = array(
"GET http://www.example.com/ HTTP/1.1",
"Host: www.example.com",
"Connection: Close"
);
$request = implode($request, "\r\n")."\r\n\r\n";
/*
* Connect to the destination address through the SOCKS chain and make a request
*/
echo $socksed->send("www.example.com", 80, $request);
/*
* Print the log messages
*/
print_r($socksed->log());
?></pre>
|