proxy-pool/examples/config/20-fetch-billing-quota.yaml

36 lines
1.2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# pool.maxSize 限当前未提取库存fetch.maxTotal 限计费周期累计获取数。
version: 1
security: {requireProtectionOnPublicListen: true}
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: 0}
routing:
- name: billed-extract
enabled: true
purpose: extract
match: {hostRegex: '.*'}
upstreams: [provider-metered]
strategy: {type: random}
onUnavailable: {action: reject}
upstreams:
provider-metered:
enabled: true
exposure: [extract]
provider: {billingMode: fetch, protocols: [http]}
api: {url: https://provider-metered.example/proxies, method: GET, auth: {type: none}, template: '{{.}}'}
proxyAuth: {type: response}
pool: {maxSize: 100}
capacity: {maxConcurrencyPerProxy: 1}
lifecycle: {ttl: 2m, allocationSafetyMargin: 15s}
fetch:
requestInterval: 1s
timeout: 3s
maxAttempts: 3
maxInFlight: 1
maxTotal: 1000
retry: {initial: 500ms, max: 30s, jitter: 20}
check: {interval: 15s, jitter: 20, maxInFlight: 100, timeout: 2s, maxAttempts: 2, maxConsecutiveFailures: 3}