transports.html

来自「php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容」· HTML 代码 · 共 113 行

HTML
113
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>List of Supported Socket Transports</title>  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="filters.encryption.html">Encryption Filters</a></div> <div class="next" style="text-align: right; float: right;"><a href="transports.unix.html">Unix Domain: Unix and UDG</a></div> <div class="up"><a href="appendices.html">Appendices</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div> <h1>List of Supported Socket Transports</h1><h2>Table of Contents</h2><ul class="chunklist chunklist_appendix"><li><a href="transports.unix.html">Unix Domain: Unix and UDG</a></li></ul> <p class="para">  The following is a list of the various URL style socket transports  that PHP has built-in for use with the streams based socket  functions such as <a href="function.fsockopen.html" class="function">fsockopen()</a>, and  <a href="function.stream-socket-client.html" class="function">stream_socket_client()</a>.  These transports do  <em class="emphasis">not</em> apply to the   <a href="ref.sockets.html" class="link">Sockets Extension</a>. </p> <p class="para">  For a list of transports installed in your version of  PHP use <a href="function.stream-get-transports.html" class="function">stream_get_transports()</a>. </p> <div id="transports.inet" class="section">  <h2 class="title">Internet Domain: TCP, UDP, SSL, and TLS</h2>  <p class="simpara">   PHP 4, PHP 5, PHP 6.   <i>ssl://</i> &amp; <i>tls://</i> since PHP 4.3.0   <i>sslv2://</i> &amp; <i>sslv3://</i> since PHP 5.0.2  </p>  <blockquote><p><b class="note">Note</b>:    <span class="simpara">    If no transport is specified, <i>tcp://</i> will be assumed.   </span>  </p></blockquote>  <ul class="itemizedlist">   <li class="listitem"><span class="simpara"><i>127.0.0.1</i></span></li>   <li class="listitem"><span class="simpara"><i>fe80::1</i></span></li>   <li class="listitem"><span class="simpara"><i>www.example.com</i></span></li>   <li class="listitem"><span class="simpara"><i>tcp://127.0.0.1</i></span></li>   <li class="listitem"><span class="simpara"><i>tcp://fe80::1</i></span></li>   <li class="listitem"><span class="simpara"><i>tcp://www.example.com</i></span></li>   <li class="listitem"><span class="simpara"><i>udp://www.example.com</i></span></li>   <li class="listitem"><span class="simpara"><i>ssl://www.example.com</i></span></li>   <li class="listitem"><span class="simpara"><i>sslv2://www.example.com</i></span></li>   <li class="listitem"><span class="simpara"><i>sslv3://www.example.com</i></span></li>   <li class="listitem"><span class="simpara"><i>tls://www.example.com</i></span></li>  </ul>  <p class="simpara">   Internet Domain sockets expect a port number in addition   to a target address.  In the case of <a href="function.fsockopen.html" class="function">fsockopen()</a>   this is specified in a second parameter and therefore does   not impact the formatting of transport URL.  With   <a href="function.stream-socket-client.html" class="function">stream_socket_client()</a> and related functions   as with traditional URLs however, the port number is specified   as a suffix of the transport URL delimited by a colon.  </p>  <ul class="itemizedlist">   <li class="listitem"><span class="simpara"><i>tcp://127.0.0.1:80</i></span></li>   <li class="listitem"><span class="simpara"><i>tcp://[fe80::1]:80</i></span></li>   <li class="listitem"><span class="simpara"><i>tcp://www.example.com:80</i></span></li>  </ul>  <blockquote><p><b class="note">Note</b>:    <b>IPv6 numeric addresses with port numbers</b><br />   <span class="simpara">    In the second example above, while the IPv4 and hostname    examples are left untouched apart from the addition of     their colon and portnumber, the IPv6 address is wrapped in    square brackets: <i>[fe80::1]</i>.  This is to    distinguish between the colons used in an IPv6 address and    the colon used to delimit the portnumber.   </span>  </p></blockquote>  <p class="simpara">   The <i>ssl://</i> and <i>tls://</i> transports    (available only when openssl support is compiled into PHP) are extensions    of the <i>tcp://</i> transport which include SSL encryption.   Since PHP 4.3.0 OpenSSL support must be statically    compiled into PHP, since PHP 5.0.0   it may be compiled as a module or statically.  </p>  <p class="simpara">   <i>ssl://</i> will attempt to negotiate an SSL V2,   or SSL V3 connection depending on the capabilities and preferences   of the remote host.  <i>sslv2://</i> and    <i>sslv3://</i> will select the SSL V2 or SSL V3   protocol explicitly.  </p> </div> </div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="filters.encryption.html">Encryption Filters</a></div> <div class="next" style="text-align: right; float: right;"><a href="transports.unix.html">Unix Domain: Unix and UDG</a></div> <div class="up"><a href="appendices.html">Appendices</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?