Skip to content

feat(proxy): selective proxy for Railway IP-blocked providers - #2020

Merged
Flotapponnier merged 5 commits into
devfrom
feat/proxy-ip-unblock
Aug 19, 2026
Merged

feat(proxy): selective proxy for Railway IP-blocked providers#2020
Flotapponnier merged 5 commits into
devfrom
feat/proxy-ip-unblock

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

Summary

  • rpc-capabilities: Adds initSelectiveProxy() in main.go — patches http.DefaultTransport with a per-host proxy function. Set PROBE_PROXY_URL + PROBE_PROXY_HOSTS env vars on the 3 Railway services to unblock specific providers (e.g. public.blastapi.io) without routing other measurements through the proxy (which would corrupt latency numbers).
  • pm-rate-limits: New proxy.go with makeTransport(useProxy bool) helper. Venue.UseProxy=true routes that venue through PROBE_PROXY_URL. Fixes predictit and smarkets (both Railway IP-blocked). Also fixes smarkets list URL (sort=popular was rejected by their API — updated to sort=start_datetime,id).
  • cronos-zkevm-rpc.yml: Removes blastapi provider (Blast API has no public Cronos zkEVM endpoint). Updates counts from 3 → 2 throughout.

Railway env vars to set after merge

pm-rate-limits service:

PROBE_PROXY_URL=http://ahamwkse-rotate:rxlan97jaffe@p.webshare.io:80

rpc-capabilities (us/eu/sgp) — when a specific host needs unblocking:

PROBE_PROXY_URL=http://ahamwkse-rotate:rxlan97jaffe@p.webshare.io:80
PROBE_PROXY_HOSTS=<comma-separated hostnames>

Test plan

  • pm-rate-limits builds locally (go build ./...)
  • rpc-capabilities builds locally (go build ./...)
  • After Railway redeploy, predictit and smarkets appear in pmapi_request_duration_seconds_bucket
  • Existing venues (polymarket, kalshi, limitless, manifold, myriad) latency unchanged — they don't use proxy

dev → main: RPC benches 222-231, provider fixes, Greymass logo
- rpc-capabilities: patch http.DefaultTransport at startup with a host-keyed
  proxy function; PROBE_PROXY_URL + PROBE_PROXY_HOSTS env vars control which
  providers route through the rotating proxy vs direct connection
- pm-rate-limits: add proxy.go with makeTransport() helper; UseProxy field on
  Venue routes blocked venues (predictit, smarkets) through PROBE_PROXY_URL;
  cold and ramp clients use makeTransport() so proxy applies consistently
- venues.go: mark predictit + smarkets UseProxy=true; fix smarkets list URL
  (sort=popular was rejected by API, replaced with sort=start_datetime,id)
- cronos-zkevm-rpc.yml: remove blastapi provider (no public endpoint exists),
  update counts from 3 to 2 providers throughout
@Flotapponnier
Flotapponnier merged commit f171017 into dev Aug 19, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant