diff --git a/test/java/src/TestClient.java b/test/java/src/TestClient.java
index fda37de..46a4ca5 100644
--- a/test/java/src/TestClient.java
+++ b/test/java/src/TestClient.java
@@ -3,7 +3,9 @@
 // Generated code
 import thrift.test.*;
 
+import com.facebook.thrift.transport.TTransport;
 import com.facebook.thrift.transport.TSocket;
+import com.facebook.thrift.transport.THttpClient;
 import com.facebook.thrift.transport.TTransportException;
 import com.facebook.thrift.protocol.TBinaryProtocol;
 
@@ -23,24 +25,41 @@
     try {
       String host = "localhost";
       int port = 9090;
+      String url = null;
       int numTests = 1;
-      
-      if (args.length > 0) {
-        host = args[0];
-      }
-      if (args.length > 1) {
-        port = Integer.valueOf(args[1]);
-      }
-      if (args.length > 2) {
-        numTests = Integer.valueOf(args[2]);
+
+      try {
+        for (int i = 0; i < args.length; ++i) {
+          if (args[i].equals("-h")) {
+            String[] hostport = (args[++i]).split(";");
+            host = hostport[0];
+            port = Integer.valueOf(hostport[1]);            
+          }
+
+          if (args[i].equals("-u")) {
+            url = args[++i];
+          }
+
+          if (args[i].equals("-n")) {
+            numTests = Integer.valueOf(args[++i]);
+          }
+        }
+      } catch (Exception x) {
+        x.printStackTrace();
       }
       
-      TSocket tSocket =
-        new TSocket(host, port);
+      TTransport transport;
+      
+      if (url != null) {
+        transport = new THttpClient(url);
+      } else {
+        transport = new TSocket(host, port);
+      }
+
       TBinaryProtocol binaryProtocol =
         new TBinaryProtocol();
       ThriftTest.Client testClient =
-        new ThriftTest.Client(tSocket, binaryProtocol);
+        new ThriftTest.Client(transport, binaryProtocol);
 
       long timeMin = 0;
       long timeMax = 0;
@@ -53,7 +72,7 @@
          */
         System.out.println("Test #" + (test+1) + ", " + "connect " + host + ":" + port);
         try {
-          tSocket.open();
+          transport.open();
         } catch (TTransportException ttx) {
           System.out.println("Connect failed: " + ttx.getMessage());
           continue;
@@ -322,7 +341,7 @@
         }
         timeTot += tot;
 
-        tSocket.close();
+        transport.close();
       }
 
       long timeAvg = timeTot / numTests;
