2020-10-15 18:42:54 +02:00
|
|
|
---
|
|
|
|
title: danog\MadelineProto\Settings\Connection: Connection settings.
|
|
|
|
description:
|
|
|
|
|
|
|
|
---
|
|
|
|
# `danog\MadelineProto\Settings\Connection`
|
|
|
|
[Back to index](../../../index.md)
|
|
|
|
|
|
|
|
> Author: Daniil Gentili <daniil@daniil.it>
|
|
|
|
|
|
|
|
|
|
|
|
Connection settings.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Method list:
|
|
|
|
* `getProtocol(): string`
|
|
|
|
* `setProtocol(class-string<\danog\MadelineProto\Stream\MTProtoBufferInterface> $protocol): self`
|
|
|
|
* `getIpv6(): bool`
|
|
|
|
* `setIpv6(bool $ipv6): self`
|
|
|
|
* `getSslSubdomains(): array`
|
|
|
|
* `setSslSubdomains(array $sslSubdomains): self`
|
|
|
|
* `getMinMediaSocketCount(): int`
|
|
|
|
* `setMinMediaSocketCount(int $minMediaSocketCount): self`
|
|
|
|
* `getMaxMediaSocketCount(): int`
|
|
|
|
* `setMaxMediaSocketCount(int $maxMediaSocketCount): self`
|
|
|
|
* `getRobinPeriod(): int`
|
|
|
|
* `setRobinPeriod(int $robinPeriod): self`
|
|
|
|
* `getDefaultDc(): int`
|
|
|
|
* `getDefaultDcParams(): array`
|
|
|
|
* `setDefaultDc(int $defaultDc): self`
|
|
|
|
* `getProxies(): array`
|
|
|
|
* `addProxy(class-string<\danog\MadelineProto\Stream\StreamInterface> $proxy, array $extra): self`
|
|
|
|
* `setProxy(array $proxies): self`
|
|
|
|
* `clearProxies(): self`
|
|
|
|
* `removeProxy(string $proxy, array $extra): self`
|
|
|
|
* `getObfuscated(): bool`
|
|
|
|
* `setObfuscated(bool $obfuscated): self`
|
|
|
|
* `getTestMode(): bool`
|
|
|
|
* `setTestMode(bool $testMode): self`
|
|
|
|
* `getTransport(): class-string<\danog\MadelineProto\Stream\RawStreamInterface>`
|
|
|
|
* `setTransport(class-string<\danog\MadelineProto\Stream\RawStreamInterface> $transport): self`
|
|
|
|
* `getRetry(): bool`
|
|
|
|
* `setRetry(bool $retry): self`
|
|
|
|
* `getTimeout(): int`
|
|
|
|
* `setTimeout(int $timeout): self`
|
|
|
|
* `getUseDoH(): bool`
|
|
|
|
* `setUseDoH(bool $useDoH): self`
|
|
|
|
* `getBindTo(): ?string`
|
|
|
|
* `setBindTo(?string $bindTo): self`
|
|
|
|
* `hasChanged(): bool`
|
|
|
|
|
|
|
|
## Methods:
|
|
|
|
### `getProtocol(): string`
|
|
|
|
|
|
|
|
Get protocol identifier.
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `setProtocol(class-string<\danog\MadelineProto\Stream\MTProtoBufferInterface> $protocol): self`
|
|
|
|
|
|
|
|
Set protocol identifier.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$protocol`: `class-string<\danog\MadelineProto\Stream\MTProtoBufferInterface>` Protocol identifier
|
|
|
|
|
|
|
|
|
|
|
|
#### See also:
|
|
|
|
* `\danog\MadelineProto\Stream\MTProtoBufferInterface`
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `getIpv6(): bool`
|
|
|
|
|
|
|
|
Get whether to use ipv6.
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `setIpv6(bool $ipv6): self`
|
|
|
|
|
|
|
|
Set whether to use ipv6.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$ipv6`: `bool` Whether to use ipv6
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `getSslSubdomains(): array`
|
|
|
|
|
|
|
|
Get subdomains of web.telegram.org for https protocol.
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `setSslSubdomains(array $sslSubdomains): self`
|
|
|
|
|
|
|
|
Set subdomains of web.telegram.org for https protocol.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$sslSubdomains`: `array` Subdomains of web.telegram.org for https protocol.
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `getMinMediaSocketCount(): int`
|
|
|
|
|
|
|
|
Get minimum media socket count.
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `setMinMediaSocketCount(int $minMediaSocketCount): self`
|
|
|
|
|
|
|
|
Set minimum media socket count.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$minMediaSocketCount`: `int` Minimum media socket count.
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `getMaxMediaSocketCount(): int`
|
|
|
|
|
|
|
|
Get maximum media socket count.
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `setMaxMediaSocketCount(int $maxMediaSocketCount): self`
|
|
|
|
|
|
|
|
Set maximum media socket count.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$maxMediaSocketCount`: `int` Maximum media socket count.
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `getRobinPeriod(): int`
|
|
|
|
|
|
|
|
Get robin period (seconds).
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `setRobinPeriod(int $robinPeriod): self`
|
|
|
|
|
|
|
|
Set robin period (seconds).
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$robinPeriod`: `int` Robin period (seconds).
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `getDefaultDc(): int`
|
|
|
|
|
|
|
|
Get default DC ID.
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `getDefaultDcParams(): array`
|
|
|
|
|
|
|
|
Get default DC params.
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `setDefaultDc(int $defaultDc): self`
|
|
|
|
|
|
|
|
Set default DC ID.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$defaultDc`: `int` Default DC ID.
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `getProxies(): array`
|
|
|
|
|
|
|
|
Get proxy identifiers.
|
|
|
|
|
|
|
|
|
|
|
|
Fully typed return value:
|
|
|
|
```
|
|
|
|
array<class-string<\danog\MadelineProto\Stream\StreamInterface>, array>
|
|
|
|
```
|
|
|
|
#### See also:
|
|
|
|
* `\danog\MadelineProto\Stream\StreamInterface`
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `addProxy(class-string<\danog\MadelineProto\Stream\StreamInterface> $proxy, array $extra): self`
|
|
|
|
|
|
|
|
Add proxy identifier to list.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$proxy`: `class-string<\danog\MadelineProto\Stream\StreamInterface>` Proxy identifier
|
|
|
|
* `$extra`: `array` Extra
|
|
|
|
|
|
|
|
|
|
|
|
#### See also:
|
|
|
|
* `\danog\MadelineProto\Stream\StreamInterface`
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `setProxy(array $proxies): self`
|
|
|
|
|
|
|
|
Set proxies.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$proxies`: `array` Proxies
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `clearProxies(): self`
|
|
|
|
|
|
|
|
Clear proxies.
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `removeProxy(string $proxy, array $extra): self`
|
|
|
|
|
|
|
|
Remove specific proxy pair.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$proxy`: `string`
|
|
|
|
* `$extra`: `array`
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `getObfuscated(): bool`
|
|
|
|
|
|
|
|
Get whether to use the obfuscated protocol.
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `setObfuscated(bool $obfuscated): self`
|
|
|
|
|
|
|
|
Set whether to use the obfuscated protocol.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$obfuscated`: `bool` Whether to use the obfuscated protocol.
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `getTestMode(): bool`
|
|
|
|
|
|
|
|
Get whether we're in test mode.
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `setTestMode(bool $testMode): self`
|
|
|
|
|
|
|
|
Set whether we're in test mode.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$testMode`: `bool` Whether we're in test mode.
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `getTransport(): class-string<\danog\MadelineProto\Stream\RawStreamInterface>`
|
|
|
|
|
|
|
|
Get transport identifier.
|
|
|
|
|
|
|
|
|
|
|
|
#### See also:
|
|
|
|
* `\danog\MadelineProto\Stream\RawStreamInterface`
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `setTransport(class-string<\danog\MadelineProto\Stream\RawStreamInterface> $transport): self`
|
|
|
|
|
|
|
|
Set transport identifier.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$transport`: `class-string<\danog\MadelineProto\Stream\RawStreamInterface>` Transport identifier.
|
|
|
|
|
|
|
|
|
|
|
|
#### See also:
|
|
|
|
* `\danog\MadelineProto\Stream\RawStreamInterface`
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `getRetry(): bool`
|
|
|
|
|
|
|
|
Get whether to retry connection.
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `setRetry(bool $retry): self`
|
|
|
|
|
|
|
|
Set whether to retry connection.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$retry`: `bool` Whether to retry connection.
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `getTimeout(): int`
|
|
|
|
|
|
|
|
Get connection timeout.
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `setTimeout(int $timeout): self`
|
|
|
|
|
|
|
|
Set connection timeout.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$timeout`: `int` Connection timeout.
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `getUseDoH(): bool`
|
|
|
|
|
|
|
|
Get whether to use DNS over HTTPS.
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `setUseDoH(bool $useDoH): self`
|
|
|
|
|
|
|
|
Set whether to use DNS over HTTPS.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$useDoH`: `bool` Whether to use DNS over HTTPS
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `getBindTo(): ?string`
|
|
|
|
|
|
|
|
Get bind on specific address and port.
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `setBindTo(?string $bindTo): self`
|
|
|
|
|
|
|
|
Set bind on specific address and port.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$bindTo`: `?string` Bind on specific address and port.
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
|
|
|
### `hasChanged(): bool`
|
|
|
|
|
|
|
|
Get whether this setting was changed, also applies changes.
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|
2020-10-15 18:42:54 +02:00
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|