@@ -107,7 +107,7 @@ $http = new React\Http\HttpServer(function (Psr\Http\Message\ServerRequestInterf
107107 );
108108});
109109
110- $socket = new React\Socket\Server( 8080);
110+ $socket = new React\Socket\SocketServer('127.0.0.1: 8080' );
111111$http->listen($socket);
112112```
113113
@@ -260,7 +260,6 @@ like this:
260260``` php
261261$browser = new React\Http\Browser(
262262 new React\Socket\Connector(
263- null,
264263 array(
265264 'timeout' => 5
266265 )
@@ -604,7 +603,7 @@ $proxy = new Clue\React\HttpProxy\ProxyConnector(
604603 new React\Socket\Connector()
605604);
606605
607- $connector = new React\Socket\Connector(null, array(
606+ $connector = new React\Socket\Connector(array(
608607 'tcp' => $proxy,
609608 'dns' => false
610609));
@@ -631,7 +630,7 @@ $proxy = new Clue\React\Socks\Client(
631630 new React\Socket\Connector()
632631);
633632
634- $connector = new React\Socket\Connector(null, array(
633+ $connector = new React\Socket\Connector(array(
635634 'tcp' => $proxy,
636635 'dns' => false
637636));
@@ -660,7 +659,7 @@ plain HTTP and TLS-encrypted HTTPS.
660659``` php
661660$proxy = new Clue\React\SshProxy\SshSocksConnector('me@localhost:22', Loop::get());
662661
663- $connector = new React\Socket\Connector(null, array(
662+ $connector = new React\Socket\Connector(array(
664663 'tcp' => $proxy,
665664 'dns' => false
666665));
@@ -741,13 +740,13 @@ to be attached to an instance of
741740[ ` React\Socket\ServerInterface ` ] ( https://github.com/reactphp/socket#serverinterface )
742741through the [ ` listen() ` ] ( #listen ) method as described in the following
743742chapter. In its most simple form, you can attach this to a
744- [ ` React\Socket\Server ` ] ( https://github.com/reactphp/socket#server ) in order
745- to start a plaintext HTTP server like this:
743+ [ ` React\Socket\SocketServer ` ] ( https://github.com/reactphp/socket#socketserver )
744+ in order to start a plaintext HTTP server like this:
746745
747746``` php
748747$http = new React\Http\HttpServer($handler);
749748
750- $socket = new React\Socket\Server ('0.0.0.0:8080');
749+ $socket = new React\Socket\SocketServer ('0.0.0.0:8080');
751750$http->listen($socket);
752751```
753752
@@ -869,13 +868,13 @@ is responsible for emitting the underlying streaming connections. This
869868HTTP server needs to be attached to it in order to process any
870869connections and pase incoming streaming data as incoming HTTP request
871870messages. In its most common form, you can attach this to a
872- [ ` React\Socket\Server ` ] ( https://github.com/reactphp/socket#server ) in
873- order to start a plaintext HTTP server like this:
871+ [ ` React\Socket\SocketServer ` ] ( https://github.com/reactphp/socket#socketserver )
872+ in order to start a plaintext HTTP server like this:
874873
875874``` php
876875$http = new React\Http\HttpServer($handler);
877876
878- $socket = new React\Socket\Server ('0.0.0.0:8080');
877+ $socket = new React\Socket\SocketServer ('0.0.0.0:8080');
879878$http->listen($socket);
880879```
881880
@@ -894,15 +893,17 @@ Likewise, it's usually recommended to use a reverse proxy setup to accept
894893secure HTTPS requests on default HTTPS port ` 443 ` (TLS termination) and
895894only route plaintext requests to this HTTP server. As an alternative, you
896895can also accept secure HTTPS requests with this HTTP server by attaching
897- this to a [ ` React\Socket\Server ` ] ( https://github.com/reactphp/socket#server )
896+ this to a [ ` React\Socket\SocketServer ` ] ( https://github.com/reactphp/socket#socketserver )
898897using a secure TLS listen address, a certificate file and optional
899898` passphrase ` like this:
900899
901900``` php
902901$http = new React\Http\HttpServer($handler);
903902
904- $socket = new React\Socket\Server('tls://0.0.0.0:8443', null, array(
905- 'local_cert' => __DIR__ . '/localhost.pem'
903+ $socket = new React\Socket\SocketServer('tls://0.0.0.0:8443', array(
904+ 'tls' => array(
905+ 'local_cert' => __DIR__ . '/localhost.pem'
906+ )
906907));
907908$http->listen($socket);
908909```
@@ -1889,7 +1890,7 @@ proxy servers etc.), you can explicitly pass a custom instance of the
18891890[ ` ConnectorInterface ` ] ( https://github.com/reactphp/socket#connectorinterface ) :
18901891
18911892``` php
1892- $connector = new React\Socket\Connector(null, array(
1893+ $connector = new React\Socket\Connector(array(
18931894 'dns' => '127.0.0.1',
18941895 'tcp' => array(
18951896 'bindto' => '192.168.10.1:0'
0 commit comments