PHPackages                             clue/http-proxy-react - 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. clue/http-proxy-react

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

clue/http-proxy-react
=====================

Async HTTP proxy connector, tunnel any TCP/IP-based protocol through an HTTP CONNECT proxy server, built on top of ReactPHP

v1.10.0(5d ago)492.3M↓72.2%1620MITPHPPHP &gt;=5.3CI passing

Since Nov 1Pushed 5d ago6 watchersCompare

[ Source](https://github.com/clue/reactphp-http-proxy)[ Packagist](https://packagist.org/packages/clue/http-proxy-react)[ Docs](https://github.com/clue/reactphp-http-proxy)[ Fund](https://clue.engineering/support)[ GitHub Sponsors](https://github.com/clue)[ RSS](/packages/clue-http-proxy-react/feed)WikiDiscussions 1.x Synced 2d ago

READMEChangelog (10)Dependencies (15)Versions (17)Used By (20)

clue/reactphp-http-proxy
========================

[](#cluereactphp-http-proxy)

[![CI status](https://github.com/clue/reactphp-http-proxy/actions/workflows/ci.yml/badge.svg)](https://github.com/clue/reactphp-http-proxy/actions)[![code coverage](https://camo.githubusercontent.com/2d45ae33b28ed0c5f14fdba645e579072cf437770a215524795c9eb258581b1c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6465253230636f7665726167652d3130302532352d73756363657373)](#tests)[![installs on Packagist](https://camo.githubusercontent.com/0ddf3975eb398ee91100bca48d54b75cf8ae517194316fa0f4ccc33f9bb0c185/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636c75652f687474702d70726f78792d72656163743f636f6c6f723d626c7565266c6162656c3d696e7374616c6c732532306f6e2532305061636b6167697374)](https://packagist.org/packages/clue/http-proxy-react)

Async HTTP proxy connector, tunnel any TCP/IP-based protocol through an HTTP CONNECT proxy server, built on top of [ReactPHP](https://reactphp.org/).

HTTP CONNECT proxy servers (also commonly known as "HTTPS proxy" or "SSL proxy") are commonly used to tunnel HTTPS traffic through an intermediary ("proxy"), to conceal the origin address (anonymity) or to circumvent address blocking (geoblocking). While many (public) HTTP CONNECT proxy servers often limit this to HTTPS port `443` only, this can technically be used to tunnel any TCP/IP-based protocol (HTTP, SMTP, IMAP etc.). This library provides a simple API to create these tunneled connections for you. Because it implements ReactPHP's standard [`ConnectorInterface`](https://github.com/reactphp/socket#connectorinterface), it can simply be used in place of a normal connector. This makes it fairly simple to add HTTP CONNECT proxy support to pretty much any existing higher-level protocol implementation.

- **Async execution of connections** - Send any number of HTTP CONNECT requests in parallel and process their responses as soon as results come in. The Promise-based design provides a *sane* interface to working with out of order responses and possible connection errors.
- **Standard interfaces** - Allows easy integration with existing higher-level components by implementing ReactPHP's standard [`ConnectorInterface`](https://github.com/reactphp/socket#connectorinterface).
- **Lightweight, SOLID design** - Provides a thin abstraction that is [*just good enough*](https://en.wikipedia.org/wiki/Principle_of_good_enough)and does not get in your way. Builds on top of well-tested components and well-established concepts instead of reinventing the wheel.
- **Good test coverage** - Comes with an automated tests suite and is regularly tested against actual proxy servers in the wild.

**Table of contents**

- [Support us](#support-us)
- [Quickstart example](#quickstart-example)
- [Usage](#usage)
    - [ProxyConnector](#proxyconnector)
        - [Plain TCP connections](#plain-tcp-connections)
        - [Secure TLS connections](#secure-tls-connections)
        - [HTTP requests](#http-requests)
        - [Connection timeout](#connection-timeout)
        - [DNS resolution](#dns-resolution)
        - [Authentication](#authentication)
        - [Advanced HTTP headers](#advanced-http-headers)
        - [Advanced secure proxy connections](#advanced-secure-proxy-connections)
        - [Advanced Unix domain sockets](#advanced-unix-domain-sockets)
- [Install](#install)
- [Tests](#tests)
- [License](#license)
- [More](#more)

Support us
----------

[](#support-us)

I maintain an ecosystem of open-source projects that have been downloaded hundreds of millions of times and are actively maintained and continuously improved. If you find any of these projects useful, please consider [becoming a sponsor on GitHub](https://github.com/sponsors/clue). Your support helps ensure long-term maintenance and continued development. Thank you! 🚀

Quickstart example
------------------

[](#quickstart-example)

The following example code demonstrates how this library can be used to send a secure HTTPS request to google.com through a local HTTP proxy server:

```
