ConnectionOptions
in package
FinalYes
Опции открытия и эксплуатации соединения.
Tags
Table of Contents
Methods
- __construct() : mixed
- allowInsecure() : bool
- Разрешён ли небезопасный plaintext.
- allowPrivateAddresses() : self
- Копия с отключённой блокировкой частных адресов (для тестов/localhost).
- auth() : AuthCredentials|null
- Учётные данные или null.
- blockPrivateAddresses() : bool
- Блокируются ли частные адреса.
- connectTimeout() : float
- Возвращает таймаут connect.
- defaults() : self
- Создаёт опции с безопасными значениями по умолчанию.
- ioTimeout() : float
- Возвращает таймаут I/O.
- mode() : string
- Режим sync|async.
- streamContext() : array<string, mixed>
- Доп. контекст stream.
- verifyPeer() : bool
- Нужна ли проверка TLS peer.
- withAuth() : self
- Копия с учётными данными.
- withMode() : self
- Копия с другим режимом.
- withTlsPeerName() : self
- Копия с TLS peer_name / SNI для IP-pinned connect.
Methods
__construct()
public
__construct([float $connectTimeout = 5.0 ][, float $ioTimeout = 30.0 ][, bool $verifyPeer = true ][, bool $blockPrivateAddresses = true ][, bool $allowInsecure = false ][, array<string, mixed> $streamContext = [] ][, string $mode = 'sync' ][, AuthCredentials|null $auth = null ]) : mixed
Parameters
- $connectTimeout : float = 5.0
- $ioTimeout : float = 30.0
- $verifyPeer : bool = true
- $blockPrivateAddresses : bool = true
- $allowInsecure : bool = false
- $streamContext : array<string, mixed> = []
- $mode : string = 'sync'
- $auth : AuthCredentials|null = null
allowInsecure()
Разрешён ли небезопасный plaintext.
public
allowInsecure() : bool
Return values
boolallowPrivateAddresses()
Копия с отключённой блокировкой частных адресов (для тестов/localhost).
public
allowPrivateAddresses() : self
Return values
selfauth()
Учётные данные или null.
public
auth() : AuthCredentials|null
Return values
AuthCredentials|nullblockPrivateAddresses()
Блокируются ли частные адреса.
public
blockPrivateAddresses() : bool
Return values
boolconnectTimeout()
Возвращает таймаут connect.
public
connectTimeout() : float
Return values
floatdefaults()
Создаёт опции с безопасными значениями по умолчанию.
public
static defaults() : self
Return values
selfioTimeout()
Возвращает таймаут I/O.
public
ioTimeout() : float
Return values
floatmode()
Режим sync|async.
public
mode() : string
Return values
stringstreamContext()
Доп. контекст stream.
public
streamContext() : array<string, mixed>
Return values
array<string, mixed>verifyPeer()
Нужна ли проверка TLS peer.
public
verifyPeer() : bool
Return values
boolwithAuth()
Копия с учётными данными.
public
withAuth(AuthCredentials $auth) : self
Parameters
- $auth : AuthCredentials
Return values
selfwithMode()
Копия с другим режимом.
public
withMode(string $mode) : self
Parameters
- $mode : string
Return values
selfwithTlsPeerName()
Копия с TLS peer_name / SNI для IP-pinned connect.
public
withTlsPeerName(string $peerName) : self
Parameters
- $peerName : string