proxy_set_upstream
Configure a global upstream proxy for all outgoing traffic to route through SOCKS, HTTP, HTTPS, or PAC protocols, with options to bypass specific hosts.
Instructions
Set a global upstream proxy for all outgoing traffic. Supports socks4://, socks5://, http://, https://, and pac+http:// URLs.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| proxy_url | Yes | Upstream proxy URL (e.g., socks5://user:pass@host:port) | |
| no_proxy | No | Hostnames to bypass the upstream proxy |
Implementation Reference
- src/tools/upstream.ts:17-33 (handler)The handler function for the `proxy_set_upstream` tool. It calls `proxyManager.setGlobalUpstream` to apply the proxy configuration.
async ({ proxy_url, no_proxy }) => { try { await proxyManager.setGlobalUpstream({ proxyUrl: proxy_url, noProxy: no_proxy }); return { content: [{ type: "text", text: JSON.stringify({ status: "success", message: `Global upstream set to ${proxy_url}`, noProxy: no_proxy || [], }), }], }; } catch (e) { return { content: [{ type: "text", text: JSON.stringify({ status: "error", error: String(e) }) }] }; } }, - src/tools/upstream.ts:11-16 (registration)The tool registration definition for `proxy_set_upstream`, including its description and input schema using Zod.
"proxy_set_upstream", "Set a global upstream proxy for all outgoing traffic. Supports socks4://, socks5://, http://, https://, and pac+http:// URLs.", { proxy_url: z.string().describe("Upstream proxy URL (e.g., socks5://user:pass@host:port)"), no_proxy: z.array(z.string()).optional().describe("Hostnames to bypass the upstream proxy"), },