-
Notifications
You must be signed in to change notification settings - Fork 1
Proxy and Network Strategy
福狼 edited this page May 13, 2026
·
1 revision
steam-go models proxy usage as a selector instead of a single static proxy URL.
This makes proxy behavior composable, testable, and suitable for different Steam traffic types.
Different Steam traffic may need different network routes:
- Official Web API traffic
- Steam Community OpenID verification
- Public Store page traffic
- Region-sensitive requests
- Session-like browser flows
- Internal testing or debugging traffic
| Selector | Use Case |
|---|---|
| Static Proxy | Send all requests through one proxy |
| Round-Robin Proxy | Rotate across multiple proxies |
| Health-Checked Proxy | Temporarily avoid failing proxies |
| Sticky Proxy | Keep one session on the same proxy |
| Routing Proxy | Route by host and path |
selector, err := steam.NewStaticProxySelector("http://127.0.0.1:7897")
client, err := steam.NewClient(
steam.WithProxySelector(selector),
)selector, err := steam.NewRoundRobinProxySelector(
"http://127.0.0.1:7897",
"http://127.0.0.1:7898",
)selector, err := steam.NewHealthCheckedRoundRobinProxySelector(
steam.DefaultProxyHealthConfig(),
"http://127.0.0.1:7897",
"http://127.0.0.1:7898",
)
metrics := selector.(steam.ProxyMetricsProvider).ProxyMetricsSnapshot()Use this when proxies may fail independently.
base, _ := steam.NewRoundRobinProxySelector(
"http://127.0.0.1:7897",
"http://127.0.0.1:7898",
)
selector := steam.NewStickyProxySelector(base)
ctx := steam.WithProxySessionKey(context.Background(), "session-1")Use this when a browser-like or login-like flow should stay on one proxy.
selector, err := steam.NewRoutingProxySelector(
steam.ProxyRoute{
Host: "api.steampowered.com",
PathPrefix: "/ISteamUser/",
ProxyURL: "http://127.0.0.1:7897",
},
steam.ProxyRoute{
Host: "steamcommunity.com",
PathPrefix: "/openid/",
ProxyURL: "",
},
)An empty ProxyURL means direct connection.
- Prefer one global proxy policy instead of scattered custom transports.
- Use sticky proxy only when session affinity matters.
- Use health checking when proxy availability is unstable.
- Use routing when official API traffic and OpenID / Store traffic need different network paths.
- Do not hide network failures by retrying forever.
____ ____ ____ _ _ ____ ____ _ _ / ____ ___ ____ ____ _ _ ____ ____
| __ | | |___ | | |__/ |__/ \_/ / [__ | |___ |__| |\/| __ | __ | |
|__] |__| | |__| | \ | \ | / ___] | |___ | | | | |__] |__|
- 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