Tavian Barnes wrote:
Just an idea from a guy who really knows next to nothing about proxies :
If
- a proxy configuration allows you to selectively forward some requests to a
selection of sites, but not to a local file
- but what you want to do is to redirect some URLs to a local file
then can you not set up a local virtual host under some name, and forward
ditto "local" requests to that local virtual host, whose pleasure it would
be to serve the local stuff in question ?
André
The thing is, when the browser sends the request to the local virtual
host, it's treating it like a proxy server. So, the local host would
have to be able to recognise a proxy request for a certain page, and
return a local file instead, which is the same thing I'm trying to do
now.
It's probably me in this case, but I believe one of us is not
understanding this right.
At the browser level, you are requesting items from www.google.com, and
the browser is configured to use serverA as a http proxy, right ?
And what you want is that the proxy on serverA would get some stuff
really from www.google.com, but some other stuff it should deliver from
local files instead, still right ?
But that is something you cannot configure easily, because there is no
way in the proxy to tell it to forward some requests to a http server,
but serve some other ones from local files. Still right ?
So, what I mean is that on the same host hosting serverA, (which you use
as a http proxy), you also configure a separate serverB (virtual), which
can deliver some "local" files (if a suitable request URL requests
them). (or you set up serverB on a totally separate local host, whatever).
The browser requests are all directed to www.google.com, but still all
requests go through serverA, because it is the configured http proxy.
And serverA, by virtue of its proxy functionality would normally forward
these requests to www.google.com (or serve them from its cache of
www.google.com items).
Now in serverA, you set up some early URL filter which will rewrite
(modify) all requests which you do not really want to go to
www.google.com, and substitute the appropriate URL so that this item
will be instead "proxied" to serverB instead of www.google.com.
(In other words e.g., in all requests ending in ".gif", you change to
hostname to "serverB").
So for some requests, www.google.com delivers the content, while from
some others it will be serverB. But all responses eventually go back
through the serverA proxy, which delivers them to the browser.
I believe the browser wouldn't know the difference, because for him all
requests are to www.google.com (while using the proxy serverA), and
that's where it thinks it gets the responses from. I don't think that
the browser "matches" the responses back with its requests, to check
inside if they really come from the same place.
Because if it did, then the whole proxy mechanism wouldn't work in the
first place.
Or maybe I'm totally wrong with this, but it seems at least plausible, no ?
André
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
" from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]