Describe the problem/error/question
got error while setting up proxy with ip address instead of domain and non standard port.
if I set up wrong port or IP I got ERROR: The service refused the connection - perhaps it is offline
if I set up login and password like 123:[email protected] :40006
I got the same ERROR: Bad request - please check your parameters
What is the error message (if any)?
Please share your workflow
Information on your n8n setup
n8n version: 0.227.1 / 0.236.0 / 1.1.1
Database (default: SQLite): SQLite / PostgreSQL
n8n EXECUTIONS_PROCESS setting (default: own, main): main
Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
Operating system: Ubuntu
Hi @Nick_K_H Sorry you’re running into this!
Would you happen to also have logs from your proxy, too? Also, what proxy are you using? That’d be helpful in understanding a bit more of what’s going on.
1 Like
Hi!
This is commercial proxy so I don’t have access to logs.
I can request logs of n8n from our server if it wold help.
Also you can execute a process on your side - it has all the necessary credentials.
Best regards,
Nick
The issue not in the IP instead of domain:
I found something - If I request page through http
it works ok, if https
- got error.
http - ok:
https: - error:
Tested on 0.236.0
and 1.1.1
. GET/POST - doesn’t matter. Only http
vs https
scheme in target URL makes a difference.
n8n tries to connect to the proxy via HTTPS despite the scheme in HTTP Node > Options > Proxy setting
as I can see in the traffic logs.
If I’m not specifiyng a scheme in Proxy settings:
get/post + http - ok
get/post + https - error
Best regards,
Nick
Found several related topics:
I’ve seen this post about problems with the axios browser here Http request proxy fails
It proposes rollback to a previous version of the library.
Any way to do this in the n8n Desktop version? I’m also having problems routing requests. In my case via TOR.
I have a TOR node at home with GitHub - dperson/torproxy - It’s making an http proxy.
I perfectly works from CURL in the command line.
Nevertheless SOME requests do not work whilst other do:
To repeat the failure
In the comand line those…
Hey @Maxfield ,
That is interesting to know thanks, I have been thinking about a workaround for this but it won’t be a quick or easy change to make. If your proxy is using squid though it will support https_proxy which will work and is supported by a few browsers like Firefox and Chrome but the browsers don’t really matter as your users would continue to use the existing http_proxy.
axios:v1.x
← ppati000:https-over-http
opened 06:10PM - 06 Oct 22 UTC
So far, Axios did not support HTTPS requests over HTTP proxies.
This pull req… uest implements of `CONNECT` requests to establish a tunnel through the proxy. The implementation works with both `Connection: close` and `Connection: keep-alive`, so that multiple HTTPS requests can be sent after one `CONNECT`. Only Node.js is supported for now.
This pull request should fix the following issues, which still seem to be unresolved:
* https://github.com/axios/axios/issues/4531
* https://github.com/axios/axios/issues/3384
Feedback is highly appreciated!
### Caveats
If the upstream server closes the connection first (e.g., when keep-alive is disabled), the proxy may send an RST packet to the client. Here's what I believe is happening after some Wireshark debugging:
1. After sending the response, the upstream server sends TLS close_notify and FIN=1.
2. Proxy relays the packet to the client.
3. Proxy sends FIN reply to upstream server on its own (closing its connection with the upstream server)
4. Client sends TLS close_notify packet back to the proxy
5. Proxy does not understand TLS and has already closed the connection to the upstream server => sends RST to client.
6. Node.js triggers `ECONNRESET` although the HTTPS response has already been received (`res.complete === true`).
My mitigation for this issue was to ignore `ECONNRESET` errors if `res.complete === true`. This mitigation does not work with `follow-redirects`, so redirect support is disabled for HTTPS over HTTP.
axios:v1.x
← Thore1954:proxy-tunneling
opened 07:44PM - 15 Jul 23 UTC
This is similar to #5037 but has a simpler implementation adapted from [hpagent]… (https://github.com/delvedor/hpagent) and additionally supports HTTPS proxies.
Jon
September 4, 2023, 2:39pm
6
Hey @Nick_K_H ,
That looks right to me, So we are aware of some issues when using proxies with n8n which we will be looking to resolve soon. The issue itself comes from the Axios package we use not supporting https over http, If your proxy supports it you can set up https and that will work but depending on what your proxy is used for (content inspection) it may cause other issues.
2 Likes
Hi Jon!
Hope Axios will approve pull request some day. =)
P.S.: I have no control over the proxy I have to use in my project.
Best regards,
Nick
2 Likes
system
Closed
September 11, 2023, 7:17pm
8
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.