-
Notifications
You must be signed in to change notification settings - Fork 1
Why Traffic Classes
福狼 edited this page May 13, 2026
·
1 revision
Traffic classes exist because not all Steam-related HTTP requests are the same.
A simple SDK may treat all requests as one category:
one client
one retry policy
one proxy
one rate limit
one cookie jar
That is easy at first, but it becomes limiting when the SDK grows.
| Traffic | Needs |
|---|---|
| Official Web API | keys, typed JSON, retry, rate limit |
| Public Store page | browser-like headers, Referer, cache, block detection |
| OpenID verification | callback safety, possible proxy, strict state validation |
| Future session-like flows | cookies, sticky proxy, low concurrency |
steam-go uses explicit traffic classes:
steam.TrafficClassOfficialAPI
steam.TrafficClassPublicStorePageThen TrafficPolicy can configure behavior per class.
- Avoids mixing API and browser-like request behavior.
- Keeps business API methods clean.
- Makes future Store-page support easier.
- Allows safer defaults per traffic type.
- Makes proxy, cookie, and cache behavior explicit.
client, err := steam.NewClient(
steam.WithTrafficPolicy(
steam.TrafficClassPublicStorePage,
steam.TrafficPolicy{
Cache: &steam.TrafficCachePolicy{
TTL: time.Minute,
},
},
),
)Classify traffic first, then apply the right policy.
____ ____ ____ _ _ ____ ____ _ _ / ____ ___ ____ ____ _ _ ____ ____
| __ | | |___ | | |__/ |__/ \_/ / [__ | |___ |__| |\/| __ | __ | |
|__] |__| | |__| | \ | \ | / ___] | |___ | | | | |__] |__|
- 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