Socks5SocketConnector
in package
implements
SocketConnector
uses
ForbidCloning, ForbidSerialization
FinalYes
Table of Contents
Interfaces
Constants
- REPLIES = [0 => 'succeeded', 1 => 'general SOCKS server failure', 2 => 'connection not allowed by ruleset', 3 => 'Network unreachable', 4 => 'Host unreachable', 5 => 'Connection refused', 6 => 'TTL expired', 7 => 'Command not supported', 8 => 'Address type not supported']
Properties
- $password : string|null
- $proxyAddress : SocketAddress|string
- $socketConnector : SocketConnector|null
- $username : string|null
Methods
- __construct() : mixed
- __serialize() : never
- __unserialize() : never
- connect() : Socket
- Establish a socket connection to the specified URI.
- tunnel() : void
- __clone() : mixed
- writeConnectRequest() : void
- writeHello() : void
Constants
REPLIES
private
mixed
REPLIES
= [0 => 'succeeded', 1 => 'general SOCKS server failure', 2 => 'connection not allowed by ruleset', 3 => 'Network unreachable', 4 => 'Host unreachable', 5 => 'Connection refused', 6 => 'TTL expired', 7 => 'Command not supported', 8 => 'Address type not supported']
Properties
$password read-only
private
string|null
$password
= null
$proxyAddress read-only
private
SocketAddress|string
$proxyAddress
$socketConnector read-only
private
SocketConnector|null
$socketConnector
= null
$username read-only
private
string|null
$username
= null
Methods
__construct()
public
__construct(SocketAddress|string $proxyAddress[, string|null $username = null ][, string|null $password = null ][, SocketConnector|null $socketConnector = null ]) : mixed
Parameters
- $proxyAddress : SocketAddress|string
- $username : string|null = null
- $password : string|null = null
- $socketConnector : SocketConnector|null = null
__serialize()
public
final __serialize() : never
Return values
never__unserialize()
public
final __unserialize(array<string|int, mixed> $data) : never
Parameters
- $data : array<string|int, mixed>
Return values
neverconnect()
Establish a socket connection to the specified URI.
public
connect(SocketAddress|string $uri[, ConnectContext|null $context = null ][, Cancellation|null $cancellation = null ]) : Socket
Parameters
- $uri : SocketAddress|string
-
URI in scheme://host:port format. TCP is assumed if no scheme is present.
- $context : ConnectContext|null = null
-
Socket connect context to use when connecting.
- $cancellation : Cancellation|null = null
Return values
Sockettunnel()
public
static tunnel(Socket $socket, string $target, string|null $username, string|null $password, Cancellation|null $cancellation) : void
Parameters
- $socket : Socket
- $target : string
- $username : string|null
- $password : string|null
- $cancellation : Cancellation|null
__clone()
protected
final __clone() : mixed
writeConnectRequest()
private
static writeConnectRequest(Uri $uri, Socket $socket) : void
Parameters
Tags
writeHello()
private
static writeHello(string|null $username, string|null $password, Socket $socket) : void
Parameters
- $username : string|null
- $password : string|null
- $socket : Socket