Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8818343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:05:09+00:00 2026-06-14T05:05:09+00:00

I have a PHP proxy which receives a HTTP request and changes one of

  • 0

I have a PHP proxy which receives a HTTP request and changes one of the headers of the HTTP request. Once the HTTP request leaves the proxy, most of the headers should be propagated from the original request (the one received by the proxy) together with the body of the request.

This is how I do the propagation in my code:

foreach (getallheaders() as $name => $value) {
        if (($name != "Server") || ($name != "Connection") ||
                ($name != "Host") || ($name != "Cache-Control") ||
                ($header != "Content-Length")) {
            array_push($headers, "$name: $value");
        }
    }
//this is where I set the headers of the new request
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

My question: Have I covered all the headers that are not supposed to be propagated in the new request? If not, which headers should I not propagate?

Thank you in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T05:05:10+00:00Added an answer on June 14, 2026 at 5:05 am

    According to RFC 2616,

    The following HTTP/1.1 headers are hop-by-hop headers:

    - Connection
    - Keep-Alive
    - Proxy-Authenticate
    - Proxy-Authorization
    - TE
    - Trailers
    - Transfer-Encoding
    - Upgrade
    

    All other headers defined by HTTP/1.1 are end-to-end headers.

    So, the list of skipped headers in your code look like significantly differt to the proposed list. For example, neither Server, nor Host, nor Cache-Control, nor Content-Length seems appropriate for removal.

    Also, bear in mind that proxies can be transparent or not, by design. Depending from this you may consider preserving as many headers as possible.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have setup an internal proxy using php and curl. Most of it is
I have programmed a proxy.php script (listed below), which would fetch an image specified
We have a flash developer who uses calls a file called proxy.php with the
So I have a PHP proxy that gets information from a website. Let's say
I've recently been asked to help support a system which uses the PHP Proxy
I have a PHP script which downloads files to the client, in a new
Hi I have a php script which tries to do a post. I use
I have a proxy in our office which close all the trafic from certain
A have setup an internal proxy kind of thing using Curl and PHP. The
I have written a fairly simple lazy loading proxy class, which I have documented

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.