PHP Classes

PHP SOCKS5 Client: Establish TCP connections via a SOCKS 5 server

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 982 All time: 3,698 This week: 258Up
Version License PHP version Categories
socks-client 0.1.0GNU General Publi...5Networking, PHP 5
Description 

Author

This class can be used to establish TCP connections via a SOCKS 5 server.

It is an updated version of another class for the same purpose originally written by Sergey Cheeba. This version supports:

* Specifying the outgoing network interface for connecting to the SOCKS server
* Handling connection timeouts
* Tunnel DNS traffic through proxy
* SOCKS server authentication

Picture of Gunter Grodotzki
Name: Gunter Grodotzki <contact>
Classes: 1 package by
Country: South Africa South Africa
Age: 38
All time rank: 239116 in South Africa South Africa
Week rank: 312 Up4 in South Africa South Africa Up

Example

<?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);
?>


  Files folder image Files  
File Role Description
Plain text file class.socks5.php Class main lib
Accessible without login Plain text file example.php Example -

 Version Control Unique User Downloads Download Rankings  
 0%
Total:982
This week:0
All time:3,698
This week:258Up