diff -pru dillo/src/IO/http.c dillo.new/src/IO/http.c
--- dillo/src/IO/http.c Mon Apr 23 15:02:34 2001
+++ dillo.new/src/IO/http.c     Mon Apr 23 15:28:36 2001
@@ -167,6 +167,8 @@ void Http_get(ChainLink *Info, void *Dat
    void *link;
    const char *Url = Data;
    SocketData_t *S = g_new(SocketData_t, 1);
+   gint use_proxy = 0;
+   gchar *hostname;
 
    /* Reference Web data */
    S->Web = ExtraData;
@@ -175,10 +177,14 @@ void Http_get(ChainLink *Info, void *Dat
    /* Hacked-in support for proxies, inspired by Olivier Aubert */
    S->port = 80;
    if (HTTP_Proxy && !(No_Proxy && strstr(Url, No_Proxy) != NULL)) {
-      a_Url_parse(HTTP_Proxy, S->hostname, sizeof(S->hostname), &S->port);
+      use_proxy = 1;
+      hostname = (gchar *) malloc((sizeof(S->hostname)+1)*sizeof(gchar));
+      a_Url_parse(HTTP_Proxy, hostname, sizeof(S->hostname)+1, &S->port);
+      a_Url_parse(Url, S->hostname, sizeof(S->hostname), NULL);
       S->tail = (char *) Url;
    } else {
       S->tail = a_Url_parse(Url, S->hostname, sizeof(S->hostname), &S->port);
+      hostname = S->hostname;
    }
    if (!S->tail) {
       g_free(S);
@@ -203,7 +209,10 @@ void Http_get(ChainLink *Info, void *Dat
    /* Let the DNS engine solve the hostname, and when done,
     * we'll try to connect the socket */
    link = a_Chain_link_new(a_Http_ccc, Info, CCC_FWD, a_Dns_ccc);
-   a_Dns_ccc(OpStart, 0, link, S->hostname, (void *)S);
+   a_Dns_ccc(OpStart, 0, link, hostname, (void *)S);
+
+   if (use_proxy && hostname)
+      free(hostname);
 }
 
 /*
