Skip to content

ProgerXP/Phisocks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Phisocks

SOCKS4/4a/5/5h client implementation for PHP 5.2+

Standalone using native PHP sockets.

Supports basic authentication and CONNECT command.

Supports TCP and IPv4 only.

Switch between 4(5) and 4a(5h) by adjusting $remoteDNS.

Consult source code for detailed configuration info.

Released in public domain.

Usage example

// Create new instance and set it up.
$phisocks = Phisocks::make('127.0.0.1');
$phisocks->remoteDNS = true;
$phisocks->basicAuth('socksy', 'sassy');

// Open remote connection to SOCKS server which opens it to the target
// (google.com:80) and fails on error.
$phisocks->connect('google.com', 443);

// For plain HTTP requests this is not necessary but if HTTPS is expected
// you will get blank response without enavling client crypto.
$phisocks->enableCrypto();

// Everything is up to the plan - tunnel some data. HTTP here is just
// an example.
echo $phisocks->httpGET('/');

// Connection will also be dropped when the object is destroyed.
$phisocks->close();

About

SOCKS4/4a/5/5h client implementation for PHP 5.2+

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages