diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 6b07d3fcc4f1c5ff38fe0654ed10589ef3ad6cc3..14893f95be272d012fc5fe525be9b5576d8df3c8 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,11 @@
+2003-01-03  Joerg Brunsmann  <joerg_brunsmann@yahoo.de>
+
+	* gnu/gcj/protocol/http/Connection.java (proxyPort, proxyInUse,
+	proxyHost): New static fields.
+	(<clinit>): Initialize new fields.
+	(connect): Use proxy if necessary.
+	(usingProxy): Implement.
+
 2003-01-03  Eric Blake  <ebb9@email.byu.edu>
 
 	* java/util/TreeMap.java (fabricateTree): Fix off-by-one error.
diff --git a/libjava/gnu/gcj/protocol/http/Connection.java b/libjava/gnu/gcj/protocol/http/Connection.java
index caababa68233e5183d562563114c18a5dd4e50fb..1a6fc0105f91da83c2dc76b0886fb5c3c90896d2 100644
--- a/libjava/gnu/gcj/protocol/http/Connection.java
+++ b/libjava/gnu/gcj/protocol/http/Connection.java
@@ -1,6 +1,6 @@
 // Connection.java - Implementation of HttpURLConnection for http protocol.
 
-/* Copyright (C) 1999, 2000  Free Software Foundation
+/* Copyright (C) 1999, 2000, 2003  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -25,10 +25,11 @@ import java.util.Enumeration;
 /**
  * Written using on-line Java Platform 1.2 API Specification, as well
  * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
- * Status:  Minimal subset of functionality.  Proxies and Redirects
- *	not yet handled.  FileNameMap handling needs to be considered.
- *	useCaches, ifModifiedSince, and allowUserInteraction need
- *	consideration as well as doInput and doOutput.
+ * Status: Minimal subset of functionality.  Proxies only partially
+ * handled; Redirects not yet handled.  FileNameMap handling needs to
+ * be considered.  useCaches, ifModifiedSince, and
+ * allowUserInteraction need consideration as well as doInput and
+ * doOutput.
  */
 
 class Connection extends HttpURLConnection
@@ -40,6 +41,33 @@ class Connection extends HttpURLConnection
   private Vector hdrVec = new Vector();
   private BufferedInputStream bufferedIn;
 
+  private static int proxyPort = 80;
+  private static boolean proxyInUse = false;
+  private static String proxyHost = null;
+
+  static 
+  {
+    // Recognize some networking properties listed at
+    // http://java.sun.com/j2se/1.4/docs/guide/net/properties.html.
+    String port = null;
+    proxyHost = System.getProperty("http.proxyHost");
+    if (proxyHost != null)
+      {
+	proxyInUse = true;
+	if ((port = System.getProperty("http.proxyPort")) != null)
+	  {
+	    try
+	      {
+		proxyPort = Integer.parseInt(port);
+	      }
+	    catch (Throwable t)
+	      {
+		// Nothing.  
+	      }
+	  }
+      }
+  }
+
   public Connection(URL url)
   {
     super(url);
@@ -85,12 +113,20 @@ class Connection extends HttpURLConnection
 
     // Get address and port number.
     int port;
-    InetAddress destAddr = InetAddress.getByName(url.getHost());
-    if ((port = url.getPort()) == -1)
-      port = 80;
+    if (proxyInUse)
+      {
+	port = proxyPort;
+	sock = new Socket(proxyHost, port);
+      }
+    else
+      {
+	InetAddress destAddr = InetAddress.getByName(url.getHost());
+	if ((port = url.getPort()) == -1)
+	  port = 80;
+	// Open socket and output stream.
+	sock = new Socket(destAddr, port);
+      }
 
-    // Open socket and output stream.
-    sock = new Socket(destAddr, port);
     PrintWriter out = new PrintWriter(sock.getOutputStream());
 
     // Send request including any request properties that were set.
@@ -123,10 +159,9 @@ class Connection extends HttpURLConnection
       }
   }
 
-  // TODO: public boolean usingProxy()
   public boolean usingProxy()
   {
-    return false;
+    return proxyInUse;
   }
 
   // Override default method in URLConnection.