php-http/socket-client

Socket client for PHP-HTTP

Package info

github.com/php-http/socket-client

pkg:composer/php-http/socket-client

Statistics

Installs: 2 683 814

Dependents: 49

Suggesters: 4

Stars: 81

Open Issues: 1

2.4.0 2026-01-10 10:45 UTC

Requires

Suggests

None

Conflicts

Replaces

None

MIT 99bb89004e04b92bf4b688d40a1f06494a7063b3

  • Joel Wurtz <jwurtz.woop@jolicode.com>

This package is auto-updated.

Last update: 2026-06-12 08:38:48 UTC


README

👁 Latest Version
👁 Software License
👁 Build Status
👁 Code Coverage
👁 Quality Score
👁 Total Downloads

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 SSL certificates:

$ 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 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.