[vox-tech] HOWTO: use your domain search path with omsoft's proxy.
Ken Bloom
vox-tech@lists.lugod.org
Wed, 17 Mar 2004 18:08:34 -0800
Now I have a version that consults /etc/resolv.conf
#!/usr/bin/perl
$|=1;
while (<>) {
$ignore = m@http://([^:/ \n]*)@;
@response=gethostbyname($1);
s@http://$1@http://$response[0]@;
print;
}
On 2004.03.17 17:27, Ken Bloom wrote:
> I have that configured for everything that's *not* HTTP. Unfortunately,
> if you give Omsoft's transparent proxy a Host: header (as browsers today
> do), then Omsoft will try to go ahead and resolve that to get you the web
> site. Suffice to say, Omsoft isn't going to find http://my/ (I don't know
> why my web browser isn't expected to pass on an FQDN). So my proxy (which
> I needed anyway) rewrites the URL here.
>
> Perhaps there's an API I can tap into to make my perl script take
> advantage of the settings in /etc/resolv.conf, but I don't know what it
> is.
>
> (/me looks at man pages - res_query. I think I'll try that out. It seems
> there's a perl module for that.)
>
> On 2004.03.17 17:08, Mark K. Kim wrote:
>> Err... You can just add "ucdavis.edu" to /etc/resolv.conf and ALL your
>> apps that use TCP/IP should search the ucdavis.edu domain... WITHOUT
>> proxy. Example:
>>
>> search localdomain ucdavis.edu
>>
>> I *think* that's what you're trying to do, right?
>>
>> -Mark
>>
>>
>> On Wed, 17 Mar 2004, Ken Bloom wrote:
>>
>> > I wanted to be able to set my domain search path to ucdavis.edu and
>> > type http://my/ for my.ucdavis.edu or http://sisweb/ for
>> > sisweb.ucdavis.edu, and Omsoft's proxy wouldn't let me. (I actually
>> > wanted to just type "my", and my web browsers will add on the http://
>> > stuff for me)
>> >
>> > I installed Squid on my computer last night, becuase another piece of
>> > software I wanted required it, and I was able to take advantage of it
>> > to solve that problem.
>> >
>> > I added to /etc/squid.conf
>> > redirect_program /usr/local/bin/squidrewrite
>> > redirect_rewrites_host_header on
>> >
>> > and in /usr/local/bin/squidrewrite, I put:
>> > #!/usr/bin/perl
>> > #inspired by the Squid 1.1 release notes
>> > $|=1;
>> > while (<>) {
>> > s@http://([^./]*)/@http://\1.ucdavis.edu/@ unless /http...
>> localhost/;
>> > print;
>> > }
>> >
>> > The result works decently well (This still won't handle things like
>> > http://wwwcsif.cs/). Now I just have to set all my web
>> > browsers to use that proxy.
>> >
>> > I run all my own servers because I trust nobody.
>> >
>> > On that note, does anybody know of a free replacement for nntpcache
>> > that they've gotten to work? I tried newscache but couldn't make it
>> > work.
>> >
>> > --
>> > I usually have a GPG digital signature included as an attachment.
>> > See http://www.gnupg.org/ for info about these digital signatures.
>> > My key was last signed 10/14/2003. If you use GPG *please* see me
>> about
>> > signing the key. ***** My computer can't give you viruses by email.
>> ***
>> >
>>
>> --
>> Mark K. Kim
>> AIM: markus kimius
>> Homepage: http://www.cbreak.org/
>> Xanga: http://www.xanga.com/vindaci
>> Friendster: http://www.friendster.com/user.jsp?id=13046
>> PGP key fingerprint: 7324 BACA 53AD E504 A76E 5167 6822 94F0 F298 5DCE
>> PGP key available on the homepage
>> _______________________________________________
>> vox-tech mailing list
>> vox-tech@lists.lugod.org
>>
>
>--
> I usually have a GPG digital signature included as an attachment.
> See http://www.gnupg.org/ for info about these digital signatures.
> My key was last signed 10/14/2003. If you use GPG *please* see me about
> signing the key. ***** My computer can't give you viruses by email. ***
> _______________________________________________
> vox-tech mailing list
> vox-tech@lists.lugod.org
--
I usually have a GPG digital signature included as an attachment.
See http://www.gnupg.org/ for info about these digital signatures.
My key was last signed 10/14/2003. If you use GPG *please* see me about
signing the key. ***** My computer can't give you viruses by email. ***