@@ -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
@@ -261,7 +261,6 @@ like this:
261261$browser = new React\Http\Browser(
262262 null,
263263 new React\Socket\Connector(
264- null,
265264 array(
266265 'timeout' => 5
267266 )
@@ -605,7 +604,7 @@ $proxy = new Clue\React\HttpProxy\ProxyConnector(
605604 new React\Socket\Connector()
606605);
607606
608- $connector = new React\Socket\Connector(null, array(
607+ $connector = new React\Socket\Connector(array(
609608 'tcp' => $proxy,
610609 'dns' => false
611610));
@@ -632,7 +631,7 @@ $proxy = new Clue\React\Socks\Client(
632631 new React\Socket\Connector()
633632);
634633
635- $connector = new React\Socket\Connector(null, array(
634+ $connector = new React\Socket\Connector(array(
636635 'tcp' => $proxy,
637636 'dns' => false
638637));
@@ -661,7 +660,7 @@ plain HTTP and TLS-encrypted HTTPS.
661660``` php
662661$proxy = new Clue\React\SshProxy\SshSocksConnector('me@localhost:22', Loop::get());
663662
664- $connector = new React\Socket\Connector(null, array(
663+ $connector = new React\Socket\Connector(array(
665664 'tcp' => $proxy,
666665 'dns' => false
667666));
@@ -742,13 +741,13 @@ to be attached to an instance of
742741[ ` React\Socket\ServerInterface ` ] ( https://github.com/reactphp/socket#serverinterface )
743742through the [ ` listen() ` ] ( #listen ) method as described in the following
744743chapter. In its most simple form, you can attach this to a
745- [ ` React\Socket\Server ` ] ( https://github.com/reactphp/socket#server ) in order
746- to start a plaintext HTTP server like this:
744+ [ ` React\Socket\SocketServer ` ] ( https://github.com/reactphp/socket#socketserver )
745+ in order to start a plaintext HTTP server like this:
747746
748747``` php
749748$http = new React\Http\HttpServer($handler);
750749
751- $socket = new React\Socket\Server ('0.0.0.0:8080');
750+ $socket = new React\Socket\SocketServer ('0.0.0.0:8080');
752751$http->listen($socket);
753752```
754753
@@ -870,13 +869,13 @@ is responsible for emitting the underlying streaming connections. This
870869HTTP server needs to be attached to it in order to process any
871870connections and pase incoming streaming data as incoming HTTP request
872871messages. In its most common form, you can attach this to a
873- [ ` React\Socket\Server ` ] ( https://github.com/reactphp/socket#server ) in
874- order to start a plaintext HTTP server like this:
872+ [ ` React\Socket\SocketServer ` ] ( https://github.com/reactphp/socket#socketserver )
873+ in order to start a plaintext HTTP server like this:
875874
876875``` php
877876$http = new React\Http\HttpServer($handler);
878877
879- $socket = new React\Socket\Server ('0.0.0.0:8080');
878+ $socket = new React\Socket\SocketServer ('0.0.0.0:8080');
880879$http->listen($socket);
881880```
882881
@@ -895,16 +894,16 @@ Likewise, it's usually recommended to use a reverse proxy setup to accept
895894secure HTTPS requests on default HTTPS port ` 443 ` (TLS termination) and
896895only route plaintext requests to this HTTP server. As an alternative, you
897896can also accept secure HTTPS requests with this HTTP server by attaching
898- this to a [ ` React\Socket\Server ` ] ( https://github.com/reactphp/socket#server )
897+ this to a [ ` React\Socket\SocketServer ` ] ( https://github.com/reactphp/socket#socketserver )
899898using a secure TLS listen address, a certificate file and optional
900899` passphrase ` like this:
901900
902901``` php
903902$http = new React\Http\HttpServer($handler);
904903
905- $socket = new React\Socket\Server ('tls://0.0.0.0:8443', null, array(
904+ $socket = new React\Socket\SocketServer ('tls://0.0.0.0:8443', array('tls' => array(
906905 'local_cert' => __DIR__ . '/localhost.pem'
907- ));
906+ ))) ;
908907$http->listen($socket);
909908```
910909
@@ -1886,7 +1885,7 @@ proxy servers etc.), you can explicitly pass a custom instance of the
18861885[ ` ConnectorInterface ` ] ( https://github.com/reactphp/socket#connectorinterface ) :
18871886
18881887``` php
1889- $connector = new React\Socket\Connector(null, array(
1888+ $connector = new React\Socket\Connector(array(
18901889 'dns' => '127.0.0.1',
18911890 'tcp' => array(
18921891 'bindto' => '192.168.10.1:0'
0 commit comments