PHPackages                             astrahttp/http - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. astrahttp/http

ActiveLibrary[HTTP &amp; Networking](/categories/http)

astrahttp/http
==============

A high-performance, async-first HTTP client for PHP 8.2+ powered by CycleTLS. Features shared worker management, JA3/JA4 fingerprinting, and full streaming support.

v2.0.0(1mo ago)25MITGoPHP &gt;=8.2

Since Apr 13Pushed 1mo agoCompare

[ Source](https://github.com/astrahttp/http)[ Packagist](https://packagist.org/packages/astrahttp/http)[ RSS](/packages/astrahttp-http/feed)WikiDiscussions 1.x Synced 1w ago

READMEChangelog (2)Dependencies (4)Versions (5)Used By (0)

AstraHTTP PHP
=============

[](#astrahttp-php)

AstraHTTP PHP is a production-oriented wrapper around a Go-based transport engine. It is designed for high-concurrency HTTP traffic with shared worker management, TLS fingerprint customization, streaming response handling, multipart form encoding, retry support, and WebSocket / SSE protocol hooks.

This document explains the package in detail: installation, architecture, API surface, request options, response methods, streaming, retries, WebSocket / SSE usage, multipart uploads, and practical examples.

Features
--------

[](#features)

- **High Performance**Built-in goroutine pool efficiently handles large numbers of asynchronous requests with minimal overhead.
- **Custom Header Ordering (fhttp)**Full control over HTTP header order to accurately mimic real browsers and bypass strict fingerprinting systems.
- **Proxy Support**Supports multiple proxy protocols:

    - SOCKS4
    - SOCKS5
    - SOCKS5h (DNS over proxy)
- **JA3 Fingerprint Configuration**Customize TLS fingerprints (JA3) to emulate specific clients such as browsers or mobile apps.
- **HTTP/3 &amp; QUIC Support**Native support for modern transport protocols for improved performance and lower latency.
- **WebSocket Client**Built-in WebSocket client for real-time, bidirectional communication.
- **Server-Sent Events (SSE)**Native support for consuming streaming HTTP events.
- **Connection Reuse**Persistent connections (keep-alive) to reduce latency and improve throughput.
- **JA4 Fingerprinting**Advanced TLS fingerprinting beyond JA3 for more precise client emulation.

---

1. Requirements
---------------

[](#1-requirements)

- PHP 8.2 or newer
- Composer
- One of the supported platforms:
    - Android (arm64 / aarch64)
    - Ubuntu and other Linux distributions (amd64 / x86\_64, arm, arm64 / aarch64)
    - FreeBSD (amd64 / x86\_64)
    - macOS (amd64 / x86\_64, arm64)
    - Windows (x86 / 386, amd64 / x86\_64)

> **Note:** `amd64` and `x86_64` refer to the same architecture, and `arm64` is also known as `aarch64`.

---

2. Installation
---------------

[](#2-installation)

### Using Composer in a project (Recommended)

[](#using-composer-in-a-project-recommended)

```
composer require astrahttp/http
php vendor/bin/astrahttp install
```

### Installing from source

[](#installing-from-source)

- This method installs a **development version (unstable)** and is not recommended for production.

```
composer config repositories.astrahttp vcs https://github.com/astrahttp/http.git
composer require astrahttp/http:1.x-dev
php vendor/bin/astrahttp install
```

### Autoloading

[](#autoloading)

The library is PSR-4 namespaced and autoloaded through Composer:

```
require __DIR__ . '/vendor/autoload.php';
```

The main entry points are:

- `Astra\Http\Client`
- `Astra\Http\Contract\RequestOptions`
- `Astra\Http\initAstraHTTP()`

---

---

Quick start
-----------

[](#quick-start)

```
