-
Notifications
You must be signed in to change notification settings - Fork 1
Why ProxySelector
福狼 edited this page May 13, 2026
·
1 revision
ProxySelector exists because a single proxy URL is not enough for real-world Steam integrations.
A basic client might support only:
http.ProxyURL(proxyURL)This works for small cases, but it cannot express:
- rotating proxies
- health checks
- cooldown after failures
- session affinity
- routing by host and path
- direct connection fallback
- per-traffic-class proxy policy
steam-go uses:
type ProxySelector interface {
Next(req *http.Request) (*url.URL, error)
}The selector receives the request, so it can make decisions based on:
- request host
- request path
- request context
- session key
- traffic class
- proxy health state
| Feature | Why It Needs a Selector |
|---|---|
| Round-robin | Needs internal state |
| Health check | Needs failure memory |
| Sticky proxy | Needs session key |
| Routing proxy | Needs request host/path |
| Direct fallback | Needs route-level decision |
| Metrics | Needs selection and result tracking |
base, _ := steam.NewRoundRobinProxySelector(
"http://127.0.0.1:7897",
"http://127.0.0.1:7898",
)
selector := steam.NewStickyProxySelector(base)
client, err := steam.NewClient(
steam.WithProxySelector(selector),
)Proxy behavior is request policy, not just static configuration.
____ ____ ____ _ _ ____ ____ _ _ / ____ ___ ____ ____ _ _ ____ ____
| __ | | |___ | | |__/ |__/ \_/ / [__ | |___ |__| |\/| __ | __ | |
|__] |__| | |__| | \ | \ | / ___] | |___ | | | | |__] |__|
- SteamID Model
- Steam Web API Notes
- Public Store Page Access Notes
- Partner API Notes
- OpenID Notes
- A2S Notes
- Steam Keys and Access Tokens
- Steam Static Assets
- Steam VDF and addons/vdf
- Steam Web API 特性说明
- 公开商店页面访问说明
- Partner API 说明
- OpenID 说明
- A2S 说明
- Steam Key 与 Access Token
- Steam 静态资源
- Steam VDF 与 addons/vdf