|
@@ -116,14 +116,24 @@ class WebSocketClient
|
|
|
{
|
|
{
|
|
|
if (extension_loaded('swoole'))
|
|
if (extension_loaded('swoole'))
|
|
|
{
|
|
{
|
|
|
- $type = SWOOLE_TCP;
|
|
|
|
|
- if ($this->ssl)
|
|
|
|
|
- {
|
|
|
|
|
- $type |= SWOOLE_SSL;
|
|
|
|
|
|
|
+// $type = SWOOLE_TCP;
|
|
|
|
|
+// if ($this->ssl)
|
|
|
|
|
+// {
|
|
|
|
|
+// $type |= SWOOLE_SSL;
|
|
|
|
|
+// }
|
|
|
|
|
+// $this->socket = new \swoole_client($type);
|
|
|
|
|
+ if($this->ssl){
|
|
|
|
|
+ $this->socket = new \swoole_client(SWOOLE_SOCK_TCP | SWOOLE_SSL);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $this->socket = new \swoole_client(SWOOLE_SOCK_TCP);
|
|
|
}
|
|
}
|
|
|
- $this->socket = new \swoole_client($type);
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
if ($this->ssl_key_file)
|
|
if ($this->ssl_key_file)
|
|
|
{
|
|
{
|
|
|
|
|
+ var_dump($this->ssl_cert_file);
|
|
|
|
|
+ var_dump("xxaa");
|
|
|
$this->socket->set(array(
|
|
$this->socket->set(array(
|
|
|
'ssl_key_file' => $this->ssl_key_file,
|
|
'ssl_key_file' => $this->ssl_key_file,
|
|
|
'ssl_cert_file' => $this->ssl_cert_file,
|
|
'ssl_cert_file' => $this->ssl_cert_file,
|