puff/client

Fiber-aware TCP and TLS client transport for Puff

Maintainers

Package info

github.com/php-puff/client

pkg:composer/puff/client

Transparency log

Statistics

Installs: 0

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2026-08-20 01:56 UTC

This package is auto-updated.

Last update: 2026-08-20 01:58:55 UTC


README

puff/client is Puff's protocol-neutral, Fiber-aware outbound transport. It provides non-blocking TCP/TLS connections for higher-level clients such as puff/http-client and a future puff/mqtt-client.

composer require puff/client
use Puff\Client\Connector;
use Puff\Client\Endpoint;

$connection = (new Connector())->connect(new Endpoint('example.com', 443, tls: true))->await();
$connection->handlers(
    onData: static fn (string $data) => print $data,
    onClose: static fn () => null,
    onError: static fn (Throwable $error) => throw $error,
);
$connection->write("GET / HTTP/1.1\r\nHost: example.com\r\nConnection: close\r\n\r\n");

The package deliberately does not implement HTTP, MQTT, retries, redirects, or protocol framing. Those responsibilities belong to protocol packages.