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!
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.
When i run GAE with Proxy using personal computer(not deploy to cloud) , it shows
java.lang.UnsupportedOperationException: Google App Engine does not support the use of proxies.
at com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler.openConnection(URLFetchServiceStreamHandler.java:54)
at com.google.appengine.tools.development.LocalURLFetchServiceStreamHandler.openConnection(LocalURLFetchServiceStreamHandler.java:77)
at java.net.URL.openConnection(Unknown Source)