First of all, the Java 7 runtime is deprecated, so you should migrate to the Java 8 version. You can do it by specifying the Java 8 runtime in the appengine-web.xml file:
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<runtime>java8</runtime>
<threadsafe>true</threadsafe>
</appengine-web-app>
There are other features that will change with the migration to Java 8. All the changes are explained here.
Just in case the error comes because of some issue in the configuration, please make sure the instance you are using as a proxy is correctly configured (using Squid is ok). The firewall rules and access control lists should be correctly established, such as:
gcloud compute firewall-rules create [FIREWALL_RULE] --network [NETWORK] --allow tcp:3128
You should also set the proper access control entries by enabling them in the Squid config. Here are some examples:
sudo sed -i 's:#\(http_access allow localnet\):\1:' /etc/squid/squid.conf
sudo sed -i 's:#\(http_access deny to_localhost\):\1:'/etc/squid/squid.conf
If you follow this example you can test the correct use of an instance used as a proxy server.
There is a static class in Java called ApiProxy (com.google.apphosting.api
) that can be used as a collection point for all calls from user code to the application server. Here you can find all the classes and methods related to it, as well as other classes related to ApiProxy.