PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of windylea  >  Socksed  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: An example for the usage of this class
Class: Socksed
Connect to a remote machine via a SOCKS server
Author: By
Last change: Update file
Date: 3 years ago
Size: 787 bytes


Class file image Download

$socksed = new socksed;

 * Adding SOCKS server to chain
 * The format is version://username:password@hostname:port

$socksed->chain[] = "socks4://";
$socksed->chain[] = "socks4a://";
$socksed->chain[] = "socks5://[2001:0db8:0000:0000:0000:ff00:0042:8329]:12891";

 * Build a HTTP request

$request = array(
"GET HTTP/1.1",
"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("", 80, $request);

 * Print the log messages