https-proxy
The https-proxy
directive is used to forward matching requests through a specified HTTPS proxy server.
Rule Syntax
txt
pattern https-proxy://ipOrDomain[:port] [filters...]
port
is optional. If left blank, the default port443
will be used.
Parameters | Description | Detailed Documentation |
---|---|---|
pattern | An expression to match the request URL | Match Pattern Documentation |
value | IP + optional port or domain name + optional port ⚠️ Loading data from files/remote URLs is not supported | Operation Instruction Documentation |
filters | Optional filters. Supports matching: • Request URL/Method/Headers/Content • Response Status Code/Headers | Filters Documentation |
Configuration Example
txt
# Proxy requests to an HTTPS proxy: `127.0.0.1:443`
www.example.com/path https-proxy://127.0.0.1 # Default port 443
# Proxy all requests for the current domain to the HTTPS proxy: `127.0.0.1:8080`
www.example.com https-proxy://127.0.0.1:8080
# You can also use a domain name.
www.example.com/path https-proxy://test.proxy.com # Default port 443
www.example.com https-proxy://test.proxy.com:8080
Advanced Usage
By default, the upstream proxy resolves the requested domain name. However, in some scenarios, you may want to force the proxy to access a specific target IP directly (skipping DNS resolution), for example:
- Bypassing DNS poisoning
- Directly accessing a specific backend IP
- Testing services in different environments
txt
# Using query parameters
www.example.com https-proxy://127.0.0.1:8080?host=1.1.1.1
www.example.com https-proxy://127.0.0.1:8080?host=1.1.1.1:8080
# Enabling via directives
www.example.com https-proxy://127.0.0.1:8080 1.1.1.1 enable://proxyHost
www.example.com https-proxy://127.0.0.1:8080 1.1.1.1:8080 enable://proxyHost
1.1.1.1
is equivalent tohost://1.1.1.1