Download the PHP package rovazh/phpsocks without Composer
On this page you can find all versions of the php package rovazh/phpsocks. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rovazh/phpsocks
More information about rovazh/phpsocks
Files in rovazh/phpsocks
Package phpsocks
Short Description SOCKS5 proxy client, written in pure PHP with zero dependencies.
License MIT
Informations about the package phpsocks
PhpSocks
SOCKS5 proxy client, written in pure PHP with zero dependencies.
Features
- Supports SOCKS5 protocol
- Implements the CONNECT command
- Implements UDP ASSOCIATE command
- Supports username/password authentication (RFC 1929)
Requirements
- PHP 7.4 or higher
- Sockets extension enabled
Installation
Install via Composer:
Usage
Tunneling TCP connections through a SOCKS5 server (CONNECT)
Plain TCP connections
The following example demonstrates connecting to example.net
on port 80
via a SOCKS5 proxy server:
Secure TLS connections
The following example demonstrates establishing a secure
TLS connection to example.net
on port 443
via a SOCKS5 proxy server:
The connect method accepts an associative array of SSL context options that can be used to configure TLS settings when connecting to a destination host.
Note: SSL context options have no effect when using a plain TCP connection (tcp://).
Authentication
PhpSocks supports username/password authentication for SOCKS5 servers as defined in RFC 1929.
Timeout Settings
By default, the library relies on the system's
default_socket_timeout
when connecting to a SOCKS5 server.
To set a custom timeout at runtime, use the connect_timeout
option:
Additionally, you can set a timeout for sending and receiving data. By default,
this is determined by the operating system. To explicitly define it, use the timeout
option:
Relaying UDP Datagrams through a SOCKS5 Server (UDP ASSOCIATE)
The following example establishes a SOCKS5 UDP association to enable relaying UDP
datagrams to example.net
on port 5023
via a SOCKS5 proxy server:
License
PhpSocks is distributed under the terms of the MIT License. See LICENSE file for details.
All versions of phpsocks with dependencies
ext-sockets Version *