code-tool / socket-client
Socket client for PHP-HTTP
2.1.3
2024-01-24 09:55 UTC
Requires
- php: >=7.1
- nyholm/psr7: ^1.3
- php-http/httplug: ^2.0
- psr/http-client: ^1.0
- psr/http-message: ^1.0
- symfony/options-resolver: ^2.6 || ^3.4 || ^4.4 || ^5.0 || ^6.0 || ^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.2
- php-http/client-common: ^2.3
- php-http/client-integration-tests: ^3.0
- php-http/message: ^1.9
- phpunit/phpunit: ^8.5.8
Provides
Replaces
- php-http/socket-client: 2.1.0
README
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
Testing
First launch the http server:
$ ./vendor/bin/http_test_server > /dev/null 2>&1 &
Then generate ssh certificates:
$ cd ./tests/server/ssl $ ./generate.sh $ cd ../../../
Note: If you are running this on macOS and get the following error: "Error opening CA Private Key privkey.pem", check this file.
Now run the test suite:
$ composer test
Contributing
Please see our contributing guide.
Security
If you discover any security related issues, please contact us at security@php-http.org.
License
The MIT License (MIT). Please see License File for more information.