Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Perl HTML Perl6 CSS

Proposed patch for RT #90414

Bug report:

    we're using HTTP::Proxy to connect PHP scripts on our shared hosting with
    the internet. In this context a customized version of HTTP::Proxy is used
    to block connections to undesired domains.

    Things work good except for HTTPS connections because with some web
    servers we don't got any data back after the protocol handshake and
    sending POST data.

    After some investigation we found out that the size of POST data was
    related to the problem and finally we found a solution adding this line
    after the opening of the $upstream socket in the _handle_CONNECT function
    (around row 600), just after the $upstream check block:

    $upstream->setsockopt(SOL_SOCKET, SO_SNDBUF, $conn->getsockopt(SOL_SOCKET,

    In fact in our context the $upstream's "send buffer" was smaller than the
    packets incoming from $conn, so data packets sent from PHP to HTTP::Proxy
    where splitted when relayed to the external website. Our supposition is
    that this behavior breaks someway the HTTP protocol, but the fix works
    good and now HTTPS works for all websites.

    The problem was not related to our customization because we had the same
    problem using a vanilla HTTP::Proxy.

    So, thanks for your great module, and I hope my hint can be useful for
    improving the module.


    Vincenzo Buttazzo
    Responsabile sviluppo web
latest commit a3c2514d77
@book authored



This module is a pure Perl HTTP proxy.

Its main use should be to record and/or modify web sessions, so as to
help users create web robots, web testing suites, as well as proxy
systems than can transparently alter the requests to and answers from
an origin server.

The eg/ directory holds a few examples. See eg/README for details.

There is also a t/README file that explains the tests strategy.


The way the filters are implemented has changed in version 0.10
of HTTP::Proxy. You can now play with two dedicated filter classes
and notice slight changes in the HTTP::Proxy interface.


Recommended order for reading the documentation:
1) HTTP::Proxy
2) HTTP::Proxy::HeaderFilter and HTTP::Proxy::BodyFilter
3) included standard filter classes and code examples in eg/

Something went wrong with that request. Please try again.