mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-19 13:54:23 +01:00
Using new CustomProxySelector in FileDownloader
This commit is contained in:
parent
708da3bd86
commit
916de939e6
@ -29,8 +29,10 @@
|
||||
|
||||
package cc.arduino.utils.network;
|
||||
|
||||
import cc.arduino.net.CustomProxySelector;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.compress.utils.IOUtils;
|
||||
import processing.app.PreferencesData;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@ -120,7 +122,10 @@ public class FileDownloader extends Observable {
|
||||
|
||||
setStatus(Status.CONNECTING);
|
||||
|
||||
Proxy proxy = ProxySelector.getDefault().select(downloadUrl.toURI()).get(0);
|
||||
Proxy proxy = new CustomProxySelector(PreferencesData.getMap()).getProxyFor(downloadUrl.toURI());
|
||||
if ("true".equals(System.getProperty("DEBUG"))) {
|
||||
System.err.println("Using proxy " + proxy);
|
||||
}
|
||||
|
||||
HttpURLConnection connection = (HttpURLConnection) downloadUrl.openConnection(proxy);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user