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.9.0(2y ago)472.3M↓32.1%16[1 issues](https://github.com/clue/reactphp-http-proxy/issues)[1 PRs](https://github.com/clue/reactphp-http-proxy/pulls)20MITPHPPHP &gt;=5.3

Since Nov 1Pushed 1y 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 1mo ago

READMEChangelog (10)Dependencies (8)Versions (16)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)[![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)

We invest a lot of time developing, maintaining and updating our awesome open-source projects. You can help us sustain this high-quality of our work by [becoming a sponsor on GitHub](https://github.com/sponsors/clue). Sponsors get numerous benefits in return, see our [sponsoring page](https://github.com/sponsors/clue)for details.

Let's take these projects to the next level together! 🚀

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:

```
