| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
The socket client use the stream extension from PHP, which is integrated into the core.
Via Composer
$ composer require php-http/socket-clientThe SocketHttpClient class need a message factory in order to work:
$options = [];
$client = new new Http\Socket\SocketHttpClient($messageFactory, $options);The $options array allow to configure the socket client.
Here is the list of available options:
Can be a tcp remote : tcp://hostname:port
Can be a unix remote : unix://hostname:port
Do not use a tls / ssl scheme, this is handle by the ssl option.
If not set, the client will try to determine it from the request uri or host header.
As an example someone may want to pass a client certificate when using the ssl, a valid configuration for this use case would be:
$options = [
'stream_context_options' => [
'ssl' => [
'local_cert' => '/path/to/my/client-certificate.pem'
]
]
]
$client = new Http\Socket\SocketHttpClient($messageFactory, $options);First launch the http server:
$ ./vendor/bin/http_test_server > /dev/null 2>&1 &Then the test suite:
$ composer testPlease see our contributing guide.
If you discover any security related issues, please contact us at security@php-http.org.
The MIT License (MIT). Please see License File for more information.
| Back | FazBrowse Home | New Git URL |