-1

I have a Java Google App Engine webapp, which I am trying to connect to a Google Compute Engine instance running a Squid proxy. However it does not seem that the connection is working at all. Can anyone advise?

What I've done:

  • Set up a GCE f1 micro instance with Squid installed
  • Added username and password authentication for Squid
  • Set up a Google Cloud firewall rule to allow requests from port 3128 (the default Squid port)
  • Added the following to my GAE webapp:

      System.setProperty("http.proxyHost", address);
      System.setProperty("http.proxyPort", port);
      System.setProperty("http.proxyUser", user);
      System.setProperty("http.proxyPassword", password);
    
GalloCedrone
  • 4,869
  • 3
  • 25
  • 41
user2181948
  • 1,646
  • 3
  • 33
  • 60
  • Possible duplicate of [Using Google Compute Engine as a proxy for a Google App Engine web app](https://stackoverflow.com/questions/47745439/using-google-compute-engine-as-a-proxy-for-a-google-app-engine-web-app) – dsesto Dec 12 '17 at 08:20
  • Honestly I see them as two different questions on the very same topic. – GalloCedrone Dec 12 '17 at 08:53

1 Answers1

0

If you feel like you can provide more information about witch component of your solution is not working (maybe providing some logs) editing the question and I can help more with the debug that right now is only superficial.

By the way first of all I advise you to go through this small step to step guide from the official Google documentation describing how to use a gateway instance as a Squid proxy server. Maybe you can notice that you merely forgot a rule in the configuration of the Squid Proxy or to run it.

However, I would follow these classical steps in order to debug:

First of all I would try to install tcpdump if you didn't do it yet to check if it is a configuration issue or a network issue. Filter all the packets to highlight only the ones having source IP, protocol and port you expect.

  1. In case you see no packet received, it can be a firewall issue dropping your packets or a client misconfigured that is not issuing any request.

    • Add a rule in your project allowing the incoming traffic from every protocol and port and try again with tcpdump

    • If the firewall was not the issue, try to connect the proxy from the different terminal disabling the authentication of Squid Proxy.

    • if you notice that your Squid Proxy is working fine then go through the debug of your client to understand why no request was sent.

  2. If there are no issue with the traffic, try to disable authentication and to setup the debug mode of Squid to understand what is happening. By the way are you sure you messing with HTTP and HTTPS requests?

  3. Try to retrieve a simple webpage with the proxy and not the external API to reduce the area where error can be hidden.

GalloCedrone
  • 4,869
  • 3
  • 25
  • 41