集成
将Shifter与以下工具配合使用 n8n
通过两种方式将 Shifter 的住宅和 ISP 代理接入 n8n 工作流——环境级配置可一次性作用于所有 HTTP 节点,或在 HTTP Request 节点上内联配置以实现按工作流控制。
快速入门
安装
docker run -p 5678:5678 -e HTTP_PROXY=... n8nio/n8n 基本用法
# Easiest path: set HTTP_PROXY / HTTPS_PROXY when launching n8n
docker run -d --name n8n -p 5678:5678 \
-e HTTP_PROXY="customer-USERNAME-country-us-sid-123ABC:PASSWORD@p.shifter.io:443" \
-e HTTPS_PROXY="customer-USERNAME-country-us-sid-123ABC:PASSWORD@p.shifter.io:443" \
-e NO_PROXY="localhost,127.0.0.1" \
n8nio/n8n
# Every HTTP Request node will now route through Shifter automatically. 功能特性
通过 HTTP_PROXY / HTTPS_PROXY 环境变量一次性配置,所有 HTTP Request 节点将自动使用 Shifter
在 HTTP Request 节点上覆盖单节点代理,适用于每个步骤需要不同国家或会话的工作流
Function 节点可在工作流开始时生成新的 sid,在整个运行过程中保持稳定的粘性会话
支持 195+ 个国家的地理定位 — 通过表达式传递国家 / 城市 / ASN 选择器
兼容 n8n Cloud、自托管 Docker、Kubernetes Helm chart 及桌面应用
与整个 n8n 节点生态系统兼容,所有通过 HTTP 发出请求的节点均可经由 Shifter 路由
示例
通过 HTTP Request 节点配置单节点代理(UI)
当您需要对每个工作流进行精细控制(不同节点使用不同国家、每个爬虫使用粘性会话)时,可直接在 HTTP Request 节点上配置代理,无需设置环境变量。
# In the HTTP Request node:
# 1. Switch to "Generic Authentication"
# 2. Authentication: "Generic Credential Type"
# 3. Credential type: "HTTP Header Auth"
# 4. Then in the node body, add:
#
# Send Headers: ON
# Header Parameters:
# Proxy-Authorization: Basic <base64(USER:PASS)>
#
# 5. Set Request Options > Proxy:
# http://p.shifter.io:443
# Or, simpler — set "Send Body / Send Headers / Use Proxy" toggles
# and configure Proxy directly:
{
"parameters": {
"url": "https://example.com",
"options": {
"proxy": "customer-USERNAME-country-uk-sid-456DEF:PASSWORD@p.shifter.io:443",
"timeout": 30000,
"redirect": { "followRedirects": true }
}
},
"name": "Scrape UK products",
"type": "n8n-nodes-base.httpRequest"
} 通过 Function 节点实现工作流级粘性会话
在工作流开始时生成唯一的 sid,并将其传递给下游的每个 HTTP 节点,该次运行中的所有请求将共享同一个住宅 IP,非常适合多步骤采集场景。
// Function node — outputs a Shifter URL with a fresh sid + ttl
const sid = Math.random().toString(36).slice(2, 10);
const country = $json.country || "us";
return [
{
json: {
shifterProxy:
`customer-USERNAME-country-${country}-sid-${sid}-ttl-300:` +
`PASSWORD@p.shifter.io:443`,
country,
sid,
},
},
];
// Then in each downstream HTTP Request node, set:
// Proxy: ={{ $json.shifterProxy }}
//
// Every node in the run reuses the same residential IP. 地理定向分支(Switch 节点 + 多国家)
使用 Switch 节点将不同条目路由到不同分支,每个分支的 HTTP Request 节点配置不同的国家。非常适合本地化价格监控或 SERP 检查。
// Workflow shape:
//
// Schedule Trigger
// |
// Set: list of regions
// |
// Split In Batches (per region)
// |
// Switch (item.region == "us" / "uk" / "jp" / ...)
// |--- HTTP Request (proxy: country-us sid-us-001)
// |--- HTTP Request (proxy: country-uk sid-uk-001)
// |--- HTTP Request (proxy: country-jp sid-jp-001)
// |--- HTTP Request (proxy: country-de sid-de-001)
// |
// Merge -> HTML Extract -> Postgres Insert
// Or, parameterize the proxy on a single HTTP Request node:
{
"url": "https://example.com/{{$json.path}}",
"options": {
"proxy": "=customer-USERNAME-country-{{$json.region}}-sid-{{$json.region}}-{{$workflow.id}}:PASSWORD@p.shifter.io:443"
}
} 使用 Docker Compose 自托管
生产就绪方案。将 Shifter 环境变量注入 n8n 容器,在 Postgres 中持久化工作流,让每个 HTTP Request 节点无需单独配置即可使用 Shifter。
# docker-compose.yml
version: "3.8"
services:
n8n:
image: n8nio/n8n:latest
restart: unless-stopped
ports:
- "5678:5678"
environment:
# Shifter proxy for every outbound HTTP Request node
HTTP_PROXY: "customer-USERNAME-country-us-sid-prod:PASSWORD@p.shifter.io:443"
HTTPS_PROXY: "customer-USERNAME-country-us-sid-prod:PASSWORD@p.shifter.io:443"
NO_PROXY: "localhost,127.0.0.1,postgres"
DB_TYPE: postgresdb
DB_POSTGRESDB_HOST: postgres
DB_POSTGRESDB_DATABASE: n8n
DB_POSTGRESDB_USER: n8n
DB_POSTGRESDB_PASSWORD: n8n_password
N8N_BASIC_AUTH_ACTIVE: "true"
N8N_BASIC_AUTH_USER: admin
N8N_BASIC_AUTH_PASSWORD: changeme
volumes:
- n8n_data:/home/node/.n8n
depends_on:
- postgres
postgres:
image: postgres:15
restart: unless-stopped
environment:
POSTGRES_DB: n8n
POSTGRES_USER: n8n
POSTGRES_PASSWORD: n8n_password
volumes:
- postgres_data:/var/lib/postgresql/data
volumes:
n8n_data:
postgres_data: 常见问题
常见问题
关于将 Shifter 与 n8n 搭配使用的常见问题。
最简单的方式是在 n8n 进程(或容器)上设置 HTTP_PROXY 和 HTTPS_PROXY 环境变量。所有 HTTP Request 节点以及大多数发出外部请求的节点都会自动读取这些环境变量。如需对单个工作流进行控制,可直接在 HTTP Request 节点的选项中设置代理。
立即开始
开始将Shifter与以下工具配合使用 n8n
将 Shifter 的 205M+ 住宅和 ISP 代理接入您的 n8n 工作流。支持环境变量或按节点配置、粘性会话以及按条目地理定位 — 兼容云端和自托管部署。
免费试用 Shifter几分钟内完成设置,随时可取消。