Thread: http_Via but where is it?

  1. #1
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385

    http_Via but where is it?

    I am currently developing a proxy server and have discovered HTTP_VIA and HTTP_X_FORWARDED_FOR

    these are set to an IP address depending on which class of proxy is being used. I have checked through the HTTP/1.1 RFC and cannot seem to find any info, does anyone know how they are implemented.
    Monday - what a way to spend a seventh of your life

  2. #2
    PC Fixer-Upper Waldo2k2's Avatar
    Join Date
    May 2002
    Posts
    2,001
    http://www.freeproxy.ru/en/free_prox..._anonymity.htm

    try using google next time, that's all I did
    PHP and XML
    Let's talk about SAX

  3. #3
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385

    thanks

    Sorry, but not a helpful remark. That is the document i have already read and it provides no in-depth information on how it is implemented in the HTTP protocol, does it?
    Monday - what a way to spend a seventh of your life

  4. #4
    return 0;
    Join Date
    Jan 2005
    Location
    Netherlands
    Posts
    89
    If you want to create a normal anonymous proxy, don't send out the HTTP_X_FORWARDED_FOR header but do send out the HTTP_VIA header, with the IP of the proxy + software name/version. If you want to create an "elite" proxy don't send any of those two headers.

    This is what a remote server might receive from a normal proxy (one that sends out both HTTP_X_FORWARDED_FOR + HTTP_VIA headers)

    Code:
    GET / HTTP/1.1
    Host: www.blaat.com
    X-Forwarded-For: 123.45.67.89
    Via: 134.51.59.129 (MyProxy/1.0)
    Which means the proxy address is 134.51.59.129, the proxy is running MyProxy version 1.0, and the client that is using the proxy has IP 123.45.67.89
    Last edited by Snip; 02-11-2005 at 09:35 AM.

  5. #5
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385
    They are not mentioned in the RFC so i'm unsure if they are an official part of HTTP/1.1, so i am unsure if they are part of the official specification. My application must comply with this, were these headers introduced later?

    I can't find an addendum to HTTP/1.1 rfc either.
    Monday - what a way to spend a seventh of your life

  6. #6
    return 0;
    Join Date
    Jan 2005
    Location
    Netherlands
    Posts
    89
    The Via header is described in RFC 2616, section 14.45. I can't find anything on X-Forwarded-For in it though

  7. #7
    PC Fixer-Upper Waldo2k2's Avatar
    Join Date
    May 2002
    Posts
    2,001
    >>no in-depth information on how it is implemented in the HTTP protocol, does it?

    no, but you were asking merely for how they were implemented. What was in that page was exactly what snip mentioned in his reply. So I gave you what you asked for. I just assumed that since I found that page you hadn't looked hard enough; if you wanted to know where in the rfc it was defined then that's what you should have asked initially.

    So what exactly are you looking for that's in depth?
    PHP and XML
    Let's talk about SAX

  8. #8
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Google("X-Forwarded-For rfc") leads us to:
    http://www.openinfo.co.uk/apache/

    Operation relies on the X-Forwarded-For header, inserted by proxy servers. This is a non-RFC-standard request header which was introduced by the Squid caching proxy server's developers and which is now also supported, for reverse proxy server operation, by Apache 2.
    which leads us, via Google("X-Forwarded-For squid"), to:
    http://www.linofee.org/~elkner/proxy...tes-1_1.html#x

    Squid used to add a request header called "Forwarded" which appeared in some early HTTP/1.1 draft documents. This header had the format

    Forwarded: by cache-host for client-address

    Current HTTP/1.1 draft documents instead use the "Via" header, but it does not provide any standard way of indicating the client address in the request. Since a number of people missed having the originating client address in the request, Squid now adds its own request header called "X-Forwarded-For" which looks like this:

    X-Forwarded-For: 128.138.243.150, unknown, 192.52.106.30

    Entries are always IP addresses, or the word "unknown" if the address could not be determined or if it has been disabled with the 'forwarded_for' configuration option.

Popular pages Recent additions subscribe to a feed