Skip to content

Commit 10b4594

Browse files
authored
Merge pull request #426 from clue-labs/docs
2 parents b011736 + f0e7249 commit 10b4594

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,14 @@ multiple concurrent HTTP requests without blocking.
8383

8484
## Quickstart example
8585

86-
Once [installed](#install), you can use the following code to access a
87-
HTTP webserver and send some simple HTTP GET requests:
86+
Once [installed](#install), you can use the following code to access an
87+
HTTP web server and send some simple HTTP GET requests:
8888

8989
```php
90+
<?php
91+
92+
require __DIR__ . '/vendor/autoload.php';
93+
9094
$client = new React\Http\Browser();
9195

9296
$client->get('http://www.google.com/')->then(function (Psr\Http\Message\ResponseInterface $response) {
@@ -97,6 +101,10 @@ $client->get('http://www.google.com/')->then(function (Psr\Http\Message\Response
97101
This is an HTTP server which responds with `Hello World!` to every request.
98102

99103
```php
104+
<?php
105+
106+
require __DIR__ . '/vendor/autoload.php';
107+
100108
$http = new React\Http\HttpServer(function (Psr\Http\Message\ServerRequestInterface $request) {
101109
return new React\Http\Message\Response(
102110
200,
@@ -594,7 +602,7 @@ HTTP CONNECT proxy servers (also commonly known as "HTTPS proxy" or "SSL proxy")
594602
are commonly used to tunnel HTTPS traffic through an intermediary ("proxy"), to
595603
conceal the origin address (anonymity) or to circumvent address blocking
596604
(geoblocking). While many (public) HTTP CONNECT proxy servers often limit this
597-
to HTTPS port`443` only, this can technically be used to tunnel any TCP/IP-based
605+
to HTTPS port `443` only, this can technically be used to tunnel any TCP/IP-based
598606
protocol, such as plain HTTP and TLS-encrypted HTTPS.
599607

600608
```php
@@ -1282,7 +1290,7 @@ Note that (depending on the given `request-target`) certain URI components may
12821290
or may not be present, for example the `getPath(): string` method will return
12831291
an empty string for requests in `asterisk-form` or `authority-form`.
12841292
Its `getHost(): string` method will return the host as determined by the
1285-
effective request URI, which defaults to the local socket address if a HTTP/1.0
1293+
effective request URI, which defaults to the local socket address if an HTTP/1.0
12861294
client did not specify one (i.e. no `Host` header).
12871295
Its `getScheme(): string` method will return `http` or `https` depending
12881296
on whether the request was made over a secure TLS connection to the target host.
@@ -1754,7 +1762,7 @@ As such, this project only bundles a few middleware implementations that are
17541762
required to match PHP's request behavior (see below) and otherwise actively
17551763
encourages [Third-Party Middleware](#third-party-middleware) implementations.
17561764

1757-
In order to use middleware request handlers, simply pass an array with all
1765+
In order to use middleware request handlers, simply pass a list of all
17581766
callables as defined above to the [`HttpServer`](#httpserver).
17591767
The following example adds a middleware request handler that adds the current time to the request as a
17601768
header (`Request-Time`) and a final request handler that always returns a 200 code without a body:

examples/11-client-http-proxy.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
// not already running a HTTP CONNECT proxy server?
3+
// not already running an HTTP CONNECT proxy server?
44
// Try LeProxy.org or this:
55
//
66
// $ php examples/72-server-http-connect-proxy.php 127.0.0.1:8080
@@ -12,7 +12,7 @@
1212

1313
require __DIR__ . '/../vendor/autoload.php';
1414

15-
// create a new HTTP CONNECT proxy client which connects to a HTTP CONNECT proxy server listening on 127.0.0.1:8080
15+
// create a new HTTP CONNECT proxy client which connects to an HTTP CONNECT proxy server listening on 127.0.0.1:8080
1616
$proxy = new Clue\React\HttpProxy\ProxyConnector(getenv('http_proxy') ?: '127.0.0.1:8080');
1717

1818
// create a Browser object that uses the HTTP CONNECT proxy client for connections

examples/72-server-http-connect-proxy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
'Content-Type' => 'text/plain',
2525
'Allow' => 'CONNECT'
2626
),
27-
'This is a HTTP CONNECT (secure HTTPS) proxy'
27+
'This is an HTTP CONNECT (secure HTTPS) proxy'
2828
);
2929
}
3030

0 commit comments

Comments
 (0)