Created
December 27, 2011 06:08
-
-
Save charleehu/1522848 to your computer and use it in GitHub Desktop.
autoproxy2pac file download
This file contains 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
def conn = new URL("http://autoproxy2pac.appspot.com/pac/u/cafebabe.hu").openConnection(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("10.22.198.188", 8118))); | |
print("begin transfer...") | |
def count = 0; | |
conn.getInputStream().withStream { | |
def of = new File("c:\\cafebabe.hu").newOutputStream() | |
it.eachByte { | |
bt -> of.write(bt);count++;if(count%1024==0)print("."); | |
} | |
} | |
print("done. ${count} bytes") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment