I want to open an HttpURLConnection via proxy on google app engine.
I'm using java.
I've tried using the following methods.
Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("xxxxxx", 3128));
HttpURLConnection conn = (HttpURLConnection) url.openConnection(proxy);
However it shows exception
java.security.AccessControlException: access denied ("java.net.SocketPermission" "xxxx:3128" "connect,resolve")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:375)
at java.security.AccessController.checkPermission(AccessController.java:565)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
And I tried another method
System.setProperty("http.proxyHost", "xxxxx");
System.setProperty("http.proxyPort", "3128");
And it doesn't work at all.
I'm wonder is there a way can let me open an HttpURLConnection via proxy on google app engine using java?
Thank you!