소스 검색

ssl default port 443

walkor 5 년 전
부모
커밋
e8f8b7a7c2
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      Connection/AsyncTcpConnection.php

+ 5 - 1
Connection/AsyncTcpConnection.php

@@ -119,7 +119,7 @@ class AsyncTcpConnection extends TcpConnection
             }
         } else {
             if (!isset($address_info['port'])) {
-                $address_info['port'] = 80;
+                $address_info['port'] = 0;
             }
             if (!isset($address_info['path'])) {
                 $address_info['path'] = '/';
@@ -175,6 +175,10 @@ class AsyncTcpConnection extends TcpConnection
         $this->_status           = self::STATUS_CONNECTING;
         $this->_connectStartTime = \microtime(true);
         if ($this->transport !== 'unix') {
+            if (!$this->_remotePort) {
+                $this->_remotePort = $this->transport === 'ssl' ? 443 : 80;
+                $this->_remoteAddress = $this->_remoteHost.':'.$this->_remotePort;
+            }
             // Open socket connection asynchronously.
             if ($this->_contextOption) {
                 $context = \stream_context_create($this->_contextOption);