Re: redirector: are http headers available?

From: Henny Bekker <[email protected]>
Date: Wed, 7 May 1997 23:18:27 +0200 (METDST)

Dear Graham,

> I'm experimenting with the redirector, but I'm not sure how it
> works yet. As far as I can see it supplies the requested URL
> on stdin, along with the client IP, ident info if present, and
> method.
>
> I don't see any way of getting at the other HTTP headers. They're
> not in the environment - I got the redirector to print it out.
>
> What I want to do is intercept "Host:" headers, and rewrite the URLs
> to go elsewhere (like demon are doing - so that www.pizzabox.vt.com/
> is mapped to www.vt.com/~pizzabox/, for example)
>
> Here's the trivial redirector I'm using while learning, followed by the
> output.
>
> What basic understanding am I missing?
>
The redirector in Squid only translates the requesting URL to another URL..
I used the next perl script for changing references from one interface to
another..
  #!/usr/local/bin/perl
  $|=1;
  while (<>) {
    s@http://search.nic.surfnet.nl@http://search-eth.nic.surfnet.nl@;
    s@http://search.surfnet.nl@http://search-eth.nic.surfnet.nl@;
    s@http://cache.nic.surfnet.nl@http://search-eth.nic.surfnet.nl@;
    s@http://cache.surfnet.nl@http://search-eth.nic.surfnet.nl@;
    s@http://192\.87\.4\.10@http://search-eth.nic.surfnet.nl@;
    print;
  }

Cheers, Henny

-- 
-----------------------------------------------------------------------------
E-Mail: Henny.Bekker@cc.ruu.nl    ! Disclaimer: The main obstacle to progress
http    http://www.ruu.nl/~henny  !             progress is not ignorance,but
PTT:    Voice: +31 30 2536971 Fax: +31 30 2531633 ! the illusion of knowledge
X400:   /G=Henny/S=Bekker/OU=cc/O=ruu/PRMD=surf/ADMD=400net/C=nl         o
Paper:  H.J.Bekker, Utrecht University, Computer Centre              _  /- _
        Po Box 80011, 3508 TA  Utrecht  Nederland                   (_) > (_)
-----------------------------------------------------------------------------
Received on Wed May 07 1997 - 14:51:18 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:35:08 MST