Browser automation
Use the proxy with n8n (HTTP Request node)
In n8n the proxy is set directly in the HTTP Request node, credentials included. Only the requests you choose go out with the mobile IP, while the rest of the workflow keeps using the server's connection.
Step by step
- 1
In the client area set the proxy protocol to HTTP: the HTTP Request node's Proxy option accepts HTTP proxies, not SOCKS5.
- 2
In the HTTP Request node open Options › Add option › Proxy and enter the full address as http://USER:PASSWORD@HOST:PORT.
- 3
Test the node with Method GET and URL https://api.ipify.org?format=json: the response must show the proxy's mobile IP, not your n8n server's.
- 4
For a new IP, put an HTTP Request node without a proxy that calls the rotation link before your requests, followed by a Wait node (After Time Interval) of about 20 seconds.
# HTTP Request node › Options › Add option › Proxy
http://USER:PASSWORD@HOST:PORT
# Test: Method GET, URL
https://api.ipify.org?format=json
# New IP: HTTP Request node without proxy (GET), then a 20-second Wait node
ROTATION_LINK
# Self-hosted n8n, proxy for every node (docker-compose.yml › environment)
HTTP_PROXY=http://USER:PASSWORD@HOST:PORT
HTTPS_PROXY=http://USER:PASSWORD@HOST:PORT
NO_PROXY=localhost,127.0.0.1Replace USER, PASSWORD, HOST and PORT with your proxy's data (client area › proxy › Connection).
Tips
- Always start with http://: if the address isn't a valid URL, n8n ignores the proxy without an error and the request goes out from the server's IP. Check the IP after every change.
- If the password contains characters such as @, : or /, percent-encode them (for example @ becomes %40).
- A proxy set in the node takes priority over the HTTP_PROXY and HTTPS_PROXY variables: you can have one proxy for all of n8n and different proxies in individual nodes.
- With the global variables, n8n's traffic to other services goes through the proxy too: add databases, internal containers and the rotation link's domain to NO_PROXY.
- For many requests use Options › Batching (Items per Batch and Batch Interval) and, in the node settings, Retry On Fail: the pace stays steady and a request cut off by an IP change is retried.
