|
@@ -64,72 +64,84 @@ class AsyncTcpConnection extends TcpConnection
|
|
|
'sslv3' => 'sslv3',
|
|
'sslv3' => 'sslv3',
|
|
|
'tls' => 'tls'
|
|
'tls' => 'tls'
|
|
|
];
|
|
];
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Emitted when socket connection is successfully established.
|
|
* Emitted when socket connection is successfully established.
|
|
|
*
|
|
*
|
|
|
* @var ?callable
|
|
* @var ?callable
|
|
|
*/
|
|
*/
|
|
|
public $onConnect = null;
|
|
public $onConnect = null;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Emitted when websocket handshake completed (Only work when protocol is ws).
|
|
* Emitted when websocket handshake completed (Only work when protocol is ws).
|
|
|
*
|
|
*
|
|
|
* @var ?callable
|
|
* @var ?callable
|
|
|
*/
|
|
*/
|
|
|
public $onWebSocketConnect = null;
|
|
public $onWebSocketConnect = null;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Transport layer protocol.
|
|
* Transport layer protocol.
|
|
|
*
|
|
*
|
|
|
* @var string
|
|
* @var string
|
|
|
*/
|
|
*/
|
|
|
public string $transport = 'tcp';
|
|
public string $transport = 'tcp';
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Socks5 proxy.
|
|
* Socks5 proxy.
|
|
|
*
|
|
*
|
|
|
* @var string
|
|
* @var string
|
|
|
*/
|
|
*/
|
|
|
public string $proxySocks5 = '';
|
|
public string $proxySocks5 = '';
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Http proxy.
|
|
* Http proxy.
|
|
|
*
|
|
*
|
|
|
* @var string
|
|
* @var string
|
|
|
*/
|
|
*/
|
|
|
public string $proxyHttp = '';
|
|
public string $proxyHttp = '';
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Status.
|
|
* Status.
|
|
|
*
|
|
*
|
|
|
* @var int
|
|
* @var int
|
|
|
*/
|
|
*/
|
|
|
protected int $status = self::STATUS_INITIAL;
|
|
protected int $status = self::STATUS_INITIAL;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Remote host.
|
|
* Remote host.
|
|
|
*
|
|
*
|
|
|
* @var string
|
|
* @var string
|
|
|
*/
|
|
*/
|
|
|
protected string $remoteHost = '';
|
|
protected string $remoteHost = '';
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Remote port.
|
|
* Remote port.
|
|
|
*
|
|
*
|
|
|
* @var int
|
|
* @var int
|
|
|
*/
|
|
*/
|
|
|
protected int $remotePort = 80;
|
|
protected int $remotePort = 80;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Connect start time.
|
|
* Connect start time.
|
|
|
*
|
|
*
|
|
|
* @var float
|
|
* @var float
|
|
|
*/
|
|
*/
|
|
|
protected float $connectStartTime = 0;
|
|
protected float $connectStartTime = 0;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Remote URI.
|
|
* Remote URI.
|
|
|
*
|
|
*
|
|
|
* @var string
|
|
* @var string
|
|
|
*/
|
|
*/
|
|
|
protected string $remoteURI = '';
|
|
protected string $remoteURI = '';
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Context option.
|
|
* Context option.
|
|
|
*
|
|
*
|
|
|
* @var array
|
|
* @var array
|
|
|
*/
|
|
*/
|
|
|
protected array $socketContext = [];
|
|
protected array $socketContext = [];
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Reconnect timer.
|
|
* Reconnect timer.
|
|
|
*
|
|
*
|