Skip to content

Instantly share code, notes, and snippets.

@AlainODea
Created September 11, 2013 14:18
Show Gist options
  • Select an option

  • Save AlainODea/6524270 to your computer and use it in GitHub Desktop.

Select an option

Save AlainODea/6524270 to your computer and use it in GitHub Desktop.

Revisions

  1. AlainODea created this gist Sep 11, 2013.
    13 changes: 13 additions & 0 deletions WhatIsMyProxy.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    import java.net.Proxy;
    import java.net.ProxySelector;
    import java.net.URI;

    public class WhatIsMyProxy
    {
    public static void main(String[] args)
    {
    String website = args[0];
    Proxy proxy = ProxySelector.getDefault().select(URI.create(website)).iterator().next();
    System.out.format("proxy.address=%s%nproxy.type.name=%s%n", proxy.address(), proxy.type().name());
    }
    }