Skip to content

Commit 8207227

Browse files
committed
Update Readme with a link to the socket client documentation
1 parent 581e6dd commit 8207227

File tree

1 file changed

+2
-56
lines changed

1 file changed

+2
-56
lines changed

README.md

+2-56
Original file line numberDiff line numberDiff line change
@@ -9,70 +9,16 @@
99

1010
The socket client use the stream extension from PHP, which is integrated into the core.
1111

12-
## Install
13-
14-
Via Composer
15-
16-
``` bash
17-
$ composer require php-http/socket-client
18-
```
19-
2012
## Features
2113

2214
* TCP Socket Domain (tcp://hostname:port)
2315
* UNIX Socket Domain (unix:///path/to/socket.sock)
2416
* TLS / SSL Encyrption
2517
* Client Certificate (only for php > 5.6)
2618

19+
## Installation and Usage
2720

28-
## Usage
29-
30-
The SocketHttpClient class need a [message factory](https://github.com/php-http/message-factory) in order to work:
31-
32-
```php
33-
$options = [];
34-
$client = new new Http\Socket\SocketHttpClient($messageFactory, $options);
35-
```
36-
37-
The `$options` array allow to configure the socket client.
38-
39-
40-
## Options
41-
42-
Here is the list of available options:
43-
44-
* remote_socket: Specify the remote socket where the library should send the request to
45-
46-
Can be a tcp remote : tcp://hostname:port
47-
48-
Can be a unix remote : unix://hostname:port
49-
50-
Do not use a tls / ssl scheme, this is handle by the ssl option.
51-
52-
If not set, the client will try to determine it from the request uri or host header.
53-
54-
* timeout : Timeout in __milliseconds__ for writing request and reading response on the remote
55-
* ssl : Activate or deactivate the ssl / tls encryption
56-
* stream_context_options : Custom options for the context of the stream, same as [PHP stream context options](http://php.net/manual/en/context.php)
57-
58-
As an example someone may want to pass a client certificate when using the ssl, a valid configuration for this
59-
use case would be:
60-
61-
```php
62-
$options = [
63-
'stream_context_options' => [
64-
'ssl' => [
65-
'local_cert' => '/path/to/my/client-certificate.pem'
66-
]
67-
]
68-
]
69-
$client = new Http\Socket\SocketHttpClient($messageFactory, $options);
70-
```
71-
72-
* stream_context_params : Custom parameters for the context of the stream, same as [PHP stream context parameters](http://php.net/manual/en/context.params.php)
73-
* write_buffer_size : When sending the request we need to bufferize the body, this option specify the size of this buffer, default is 8192,
74-
if you are sending big file with your client it may be interesting to have a bigger value in order to increase performance.
75-
21+
[Read the documentation at http://docs.php-http.org/en/latest/clients/socket-client.html](http://docs.php-http.org/en/latest/clients/socket-client.html)
7622

7723
## Testing
7824

0 commit comments

Comments
 (0)