Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/php-http/socket-client
Socket HTTP Client
https://github.com/php-http/socket-client
Last synced: about 12 hours ago
JSON representation
Socket HTTP Client
- Host: GitHub
- URL: https://github.com/php-http/socket-client
- Owner: php-http
- License: mit
- Created: 2015-04-25T16:02:29.000Z (over 9 years ago)
- Default Branch: 2.x
- Last Pushed: 2024-09-01T11:47:59.000Z (4 months ago)
- Last Synced: 2024-09-08T05:53:21.552Z (4 months ago)
- Language: PHP
- Homepage: http://httplug.io
- Size: 170 KB
- Stars: 80
- Watchers: 13
- Forks: 39
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-http - Socket client
README
# Socket Client for PHP HTTP
[![Latest Version](https://img.shields.io/github/release/php-http/socket-client.svg?style=flat-square)](https://github.com/php-http/socket-client/releases)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
[![Build Status](https://github.com/php-http/socket-client/actions/workflows/ci.yml/badge.svg?branch=2.x)](https://github.com/php-http/socket-client/actions/workflows/ci.yml)
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-http/socket-client.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/socket-client)
[![Quality Score](https://img.shields.io/scrutinizer/g/php-http/socket-client.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/socket-client)
[![Total Downloads](https://img.shields.io/packagist/dt/php-http/socket-client.svg?style=flat-square)](https://packagist.org/packages/php-http/socket-client)The socket client use the stream extension from PHP, which is integrated into the core.
## Features
* TCP Socket Domain (tcp://hostname:port)
* UNIX Socket Domain (unix:///path/to/socket.sock)
* TLS / SSL Encyrption
* Client Certificate (only for php > 5.6)## Installation and Usage
[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)
## Testing
First launch the http server:
```bash
$ ./vendor/bin/http_test_server > /dev/null 2>&1 &
```Then generate SSL certificates:
```bash
$ composer gen-ssl
```Note: If you are running this on macOS and get the following error: "Error opening CA Private Key privkey.pem", check [this](ssl-macOS.md) file.
Now run the test suite:
``` bash
$ composer test
```## Contributing
Please see our [contributing guide](http://docs.php-http.org/en/latest/development/contributing.html).
## Security
If you discover any security related issues, please contact us at [[email protected]](mailto:[email protected]).
## License
The MIT License (MIT). Please see [License File](LICENSE) for more information.