Created
December 11, 2014 22:06
-
-
Save daleysoftware/8959b91b566ff22d74ea to your computer and use it in GitHub Desktop.
Test system proxy server settings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
import java.io.*; | |
import java.net.*; | |
public class ProxyTest | |
{ | |
public static void main(String[] args) { | |
System.setProperty("java.net.useSystemProxies", "true"); | |
List<Proxy> list = null; | |
try | |
{ | |
list = ProxySelector.getDefault().select(new URI("http://google.com")); | |
for (Proxy p : list) { | |
System.out.println(p.toString()); | |
} | |
} | |
catch (final URISyntaxException e) | |
{ | |
e.printStackTrace(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment