Google Chat (and maybe more) API Connection Fails Through Proxy

Environment Setup

  • n8n running in Docker container
  • Ollama also running in Docker container
  • Both containers configured to use my corporate proxy
  • Running on Linux environment
  • n8n version: latest

The Issue

I’ve set up n8n with Google Chat credentials, and I’m trying to use the Google Chat nodes. However, when attempting to connect to the Google Chat API, I consistently get this error:

The service failed to process your request
ERROR: The requested URL could not be retrieved
The following error was encountered while trying to retrieve the URL: https://chat.googleapis.com/v1/spaces?
**Unsupported Request Method and Protocol**
Squid does not support all request methods for all access protocols.

What’s Working

  • Regular HTTP requests within n8n work fine through the proxy
  • Ollama container successfully connects through the same proxy configuration
  • When I intercept the Google Chat API request and replicate it using curl with the same proxy settings, it works perfectly from the host

My Configuration

Both Docker containers are configured with proxies variables set

What I’ve Tried

  • Verified my Google credentials are correct (the token is valid)
  • Confirmed the proxy is accessible from the containers
  • Successfully used curl with the same request parameters through the proxy
  • Tried various proxy configuration formats

My Theory

I believe the issue might be that n8n is trying to make HTTPS requests directly through the proxy without using the CONNECT method, which our corporate Squid proxy requires for HTTPS tunneling. This is suggested by the error message “Unsupported Request Method and Protocol.”

When using curl, the CONNECT method is automatically used for HTTPS requests, which is why those work.

Questions

  1. Is there a way to configure n8n to use the CONNECT method for HTTPS requests through a proxy?
  2. How can I better debug the exact HTTP requests n8n is making to understand what’s different from curl?
  3. Are there any known issues with n8n and corporate proxies, specifically with the Google API nodes?
  4. Would setting up an intermediate proxy that handles the CONNECT method be a viable solution?

Any guidance would be greatly appreciated. I’ve spent several days trying to resolve this issue and believe it may be a specific interaction between n8n’s HTTP client, the Google API, and our corporate proxy implementation.

I am not confident, but believing your investigations.

If true, I might recommend creating an “intermediate proxy” that can route correctly or some kind of docker networking proxy.

Worked for some nodes but not all. The completions nodes didn’t work. I put N8N in my corporate cloud and now i have another issue.

The HTTP.S_PROXY/http.s_proxy is note used by my node , the variable is set in the container but it’s not used.

When i put manually in my http node the proxy, everything works fine.

I still don’t find an answer to my issue. Whare I can ask to get help ?

My company want a proper testing before buyong the entreprise edition.

Hi,

This is a known issue and as far as I can find this hasn’t been resolved.

Heres the feature request and the history

Reg,
J.

So I just can’t use N8N in my company ?

Hi, well this is best discussed with N8N themselves, whether or not they plan to /can resolve this. This is a community support forum. Another option would be an enterprise cloud solution, but again you have to talk to them. Or yet another solution: self-host in the public cloud which bypasses the squid problem

Reg,
J.