PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Gunter Grodotzki  >  PHP SOCKS5 Client  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: -
Class: PHP SOCKS5 Client
Establish TCP connections via a SOCKS 5 server
Author: By
Last change:
Date: 6 years ago
Size: 522 bytes
 

Contents

Class file image Download
<?php
error_reporting
(E_ALL);
ini_set("display_errors", true);

include(
"class.socks5.php");

$request[] = "GET / HTTP/1.1";
$request[] = "Host: www.my-ip.co.za";
$request[] = "Connection: Close";

$socks5 = new socks5("192.168.2.2", 1080, "user", "pass");
//$socks5->set_interface("192.168.2.9");
$socks5->set_timeout(10);
$socks5->set_dnstunnel(false);

if(
$socks5->connect("www.my-ip.co.za", 80) === true)
{
   
$buffer = $socks5->request(implode("\r\n", $request) . "\r\n\r\n");
   
var_dump($buffer);
}

unset(
$socks5);
?>