I am trying to use the Necko layer to do HTTP accesses, but for security reasons, the application needs control over what IP address is used for each access (it wants to make sure that a series of accesses to the same hostname all use the same IP addresses).
Attempt #1 Use URLs with IP addresses in them, and set a Host: header with the real hostname in it.
But doing that made web servers where several all use the same IP-address would sometimes end up returning cached data from the wrong server (because the cache code just uses the URL as the key, and doesn't know about the Host: that I set.)
Attempt #2 Make a class that implements nsIURI that wraps a another nsIURI but returns a different hostname for GetHost and GetAsciiHost (so the URL is the real URL, but the hostname is the particular IP address), and then set the Host: header back to the proper hostname.
But this didn't work, because trying to create a channel doesn't work on that wrapping URL.
So, what should I be doing...? Is there any way to convince the Cache to use an alternate URI/URL from the one that the rest of the HttpChannel is using? Or should I just extend #2 and make a wrapper class that implements nsStandardURL, since that seems to be the specific class that HttpChannel uses? (What needs to be true about the URI for HttpChannel to be happy with it?)
Is there some better technique to get the control that I want?
Thanks. William [EMAIL PROTECTED]
_______________________________________________ Mozilla-netlib mailing list [EMAIL PROTECTED] http://mail.mozilla.org/listinfo/mozilla-netlib
