Commits

Kevin Wetzels committed 8629979

Actually use the supplied proxy when available

Comments (0)

Files changed (2)

src/demo/java/io/bold/WebhookHandler.java

         }
         HttpServer server = HttpServer.create(new InetSocketAddress(addr, port), 2);
         server.createContext("/", new WebhookHandler());
-        server.setExecutor(null); // creates a default executor
+        server.setExecutor(null);
         server.start();
     }
 

src/main/java/io/bold/DefaultClient.java

     protected HttpURLConnection openConnection(String fmt, Object... args) throws IOException {
         URL url = createUrl(fmt, args);
         String auth = BaseEncoding.base64Url().encode((username + ":" + password).getBytes());
-        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+        HttpURLConnection connection = (HttpURLConnection) (proxy == null ? url.openConnection() : url.openConnection(proxy));
         connection.setRequestProperty("Authorization", "Basic " + auth);
         connection.setRequestProperty("User-Agent", "Bold.io Java Client");
         connection.setRequestProperty("Content-Type", "application/json");