htdig: virtual hosts saga

Michael Graff (
17 Jun 1998 14:43:04 -0700

There seems to be some support for virtual hosts. There is a section of
htlib/ which, if a config option is not set, a gethostbyname()
is done to find the true host name:

    if (!config.Boolean("allow_virtual_hosts", 1))
        static Dictionary hostbyname;
        unsigned long addr;
        struct hostent *hp;
         hp = gethostbyname(_host.get());

I made a quick hack to see if I could index a virtual site of mine.
It _seems_ to work. I did hard-code the virtual code to "on," change
HTTP/1.0 to HTTP/1.1, and add a "Connection: close" header.

I'll post diffs if it really works.

To unsubscribe from the htdig mailing list, send a message to containing the single word "unsubscribe" in
the body of the message.

This archive was generated by hypermail 2.0b3 on Sat Jan 02 1999 - 16:26:34 PST