Skip to content

Commit bac60c2

Browse files
authored
Merge pull request #24 from clue-labs/http
Link to clue/reactphp-buzz for HTTP requests
2 parents be86bef + 65d97ef commit bac60c2

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ existing higher-level protocol implementation.
3939
* [ProxyConnector](#proxyconnector)
4040
* [Plain TCP connections](#plain-tcp-connections)
4141
* [Secure TLS connections](#secure-tls-connections)
42+
* [HTTP requests](#http-requests)
4243
* [Connection timeout](#connection-timeout)
4344
* [DNS resolution](#dns-resolution)
4445
* [Authentication](#authentication)
@@ -49,7 +50,7 @@ existing higher-level protocol implementation.
4950
* [License](#license)
5051
* [More](#more)
5152

52-
### Quickstart example
53+
## Quickstart example
5354

5455
The following example code demonstrates how this library can be used to send a
5556
secure HTTPS request to google.com through a local HTTP proxy server:
@@ -188,6 +189,15 @@ $connector->connect('tls://smtp.googlemail.com:465')->then(function (ConnectionI
188189
> Note how secure TLS connections are in fact entirely handled outside of
189190
this HTTP CONNECT client implementation.
190191

192+
#### HTTP requests
193+
194+
HTTP operates on a higher layer than this low-level HTTP CONNECT implementation.
195+
If you want to issue HTTP requests, you can add a dependency for
196+
[clue/reactphp-buzz](https://github.com/clue/reactphp-buzz).
197+
It can interact with this library by issuing all
198+
[HTTP requests through a HTTP CONNECT proxy server](https://github.com/clue/reactphp-buzz#http-proxy).
199+
This works for both plain HTTP and TLS-encrypted HTTPS requests.
200+
191201
#### Connection timeout
192202

193203
By default, the `ProxyConnector` does not implement any timeouts for establishing remote

examples/01-proxy-https.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
// A simple example which requests https://google.com/ through an HTTP CONNECT proxy.
44
// The proxy can be given as first argument and defaults to localhost:8080 otherwise.
5+
//
6+
// For illustration purposes only. If you want to send HTTP requests in a real
7+
// world project, take a look at https://github.com/clue/reactphp-buzz#http-proxy
58

69
use Clue\React\HttpProxy\ProxyConnector;
710
use React\Socket\Connector;

examples/02-optional-proxy-https.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
// This example highlights how changing from direct connection to using a proxy
77
// actually adds very little complexity and does not mess with your actual
88
// network protocol otherwise.
9+
//
10+
// For illustration purposes only. If you want to send HTTP requests in a real
11+
// world project, take a look at https://github.com/clue/reactphp-buzz#http-proxy
912

1013
use Clue\React\HttpProxy\ProxyConnector;
1114
use React\Socket\Connector;

0 commit comments

Comments
 (0)