Re: [Feature request] Map hostnames to IP addresses

Betty <[email protected]>
Newsgroups gmane.comp.web.privoxy.devel
Message-ID <CAKmerWi0vjuJqd592C3WpMM_2cShC4qsEaNq4kwO9ixAi5BWgg@mail.gmail.com>
Thank you. I didn't know one could rewrite IP in the client header. I'll
try this. Thanks. :)


On Thu, Mar 7, 2013 at 9:01 PM, Fabian Keil <[email protected]> wrote:

> Betty <[email protected]> wrote:
>
> > Some domains (for example, many Google services) are blocked in China and
> > they won't resolve to the correct IP addresses. If we specify the correct
> > IPs to those domains in the "hosts" file
> > (C:\Windows\System32\drivers\etc\hosts), we can visit those sites.
> > The problem with the hosts file is that it does not support wildcards. We
> > have to write many lines in the hosts file like this:
> > 203.208.46.200 0.docs.google.com
> > 203.208.46.200 1.docs.google.com
> > 203.208.46.200 2.docs.google.com
> > 203.208.46.200 3.docs.google.com
> > 203.208.46.200 4.docs.google.com
> > 203.208.46.200 5.docs.google.com
> > 203.208.46.200 6.docs.google.com
> > 203.208.46.200 7.docs.google.com
> > 203.208.46.200 8.docs.google.com
> > 203.208.46.200 9.docs.google.com
> > This is only a small fraction. The actual file has hundreds of lines.
> > Google uses a lot of domains!
> >
> > My feature request is to let Privoxy have the ability to map certain
> > hostnames to certain IP addresses, while supporting wildcards. Hopefully
> we
> > won't need the hosts file and we can write in Privoxy's action file
> > something like:
> >
> > 203.208.46.200 *.docs.google.com
> >
> > (Please note that 203.208.46.200 is not a proxy. It is an IP used by
> > Google. Using "forward" in Privoxy does not work.)
> >
> > Is that possible? Thank you.
>
> Yes that's already possible using the client-header-filter directive:
>
> http://config.privoxy.org/user-manual/actions-file.html#CLIENT-HEADER-FILTER
>
> If you add a filter like the following to one of your filter files:
>
> CLIENT-HEADER-FILTER: rewrite-to-203.208.46.200 Rewrite the request
> destination to 203.208.46.200 and keep the Host header unmodified. May or
> may not fool the GFW of China.
> s@^(\w+) (http://)?([^/ ]+?)([/ ])@$1 $2\203.208.46.200$4@
>
> You can enable it in one of your action files with something like:
>
> {+client-header-filter{rewrite-to-203.208.46.200}}
> .docs.google.com/
>
> Note that Privoxy can also be used with Tor, though:
> http://www.privoxy.org/faq/misc.html#TOR
>
> Tor provides censorship resistance out of the box:
> https://www.torproject.org/
>
> Fabian
>

------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev

_______________________________________________
Ijbswa-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ijbswa-developers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.