54 lines
1.5 KiB
YAML
54 lines
1.5 KiB
YAML
# 本机同时启用 Gateway 与一次性独占提取 API。
|
|
version: 1
|
|
security:
|
|
requireProtectionOnPublicListen: true
|
|
gateway:
|
|
enabled: true
|
|
listen: 127.0.0.1:8080
|
|
auth: {mode: none}
|
|
retry:
|
|
maxAttempts: 2
|
|
retryMethods: [GET, HEAD]
|
|
distribution:
|
|
enabled: true
|
|
listen: 127.0.0.1:8081
|
|
auth: {mode: none}
|
|
clientIdentification: {mode: sourceIP}
|
|
extraction:
|
|
fulfillment: partial
|
|
maxCountPerRequest: 20
|
|
minRemainingTTL: 30s
|
|
maxHealthCheckAge: 15s
|
|
reserveForGateway: 5
|
|
routing:
|
|
- name: gateway-default
|
|
enabled: true
|
|
purpose: gateway
|
|
match: {hostRegex: '.*'}
|
|
upstreams: [provider-a]
|
|
strategy: {type: leastConnections}
|
|
onUnavailable: {action: reject}
|
|
- name: extract-default
|
|
enabled: true
|
|
purpose: extract
|
|
match: {hostRegex: '.*'}
|
|
upstreams: [provider-a]
|
|
strategy: {type: random}
|
|
onUnavailable: {action: reject}
|
|
upstreams:
|
|
provider-a:
|
|
enabled: true
|
|
exposure: [gateway, extract]
|
|
provider: {billingMode: fetch, protocols: [http]}
|
|
api:
|
|
url: https://provider-a.example/proxies
|
|
method: GET
|
|
auth: {type: none}
|
|
template: '{{.}}'
|
|
proxyAuth: {type: response}
|
|
pool: {maxSize: 100}
|
|
capacity: {maxConcurrencyPerProxy: 10}
|
|
lifecycle: {ttl: 2m, allocationSafetyMargin: 10s}
|
|
fetch: {requestInterval: 1s, timeout: 3s, maxAttempts: 3, maxInFlight: 1, maxTotal: 1000}
|
|
check: {interval: 30s, jitter: 20, maxInFlight: 50, timeout: 2s, maxAttempts: 2, maxConsecutiveFailures: 3}
|