REST session valid + Squid tunnel 200 to ws.kite.trade — WebSocket upgrade still 403

YC8584
Hi,

Kite Connect Python 5.2.0 — REST works, WebSocket upgrade fails with 403 using the same API key, access token, and whitelisted IP.

Setup

API key: i0vm…2ti9
Outbound IP (whitelisted): 152.42.158.128 (authenticated HTTP CONNECT proxy for all Kite traffic)
Ticker: KiteTicker(api_key, access_token, reconnect=False)
Works (REST)

Daily OAuth login OK
profile() / session validation: success
Proxy log: TCP_TUNNEL/200 CONNECT api.kite.trade:443
Fails (WebSocket)

Never reaches on_connect; connect_events=0, socket_ticks=0
Close reason:
1006: WebSocket connection upgrade failed (403 - Forbidden)
Proxy log shows tunnel succeeds to WS host:
TCP_TUNNEL/200 CONNECT ws.kite.trade:443 HIER_DIRECT/65.2.8.186
Latest attempt: unix 1787503738 (~23 Aug 2026, ~22:22 IST)
Already ruled out

Squid ACL allows .kite.trade:443 — not a proxy deny
Same token works for REST immediately after login
Proxy off → REST fails (IP not whitelisted); proxy on → REST OK, WS still 403
Questions

Why does REST accept (api_key, access_token) on 152.42.158.128 but WS upgrade returns 403?
Is WebSocket/streaming enabled separately for this API key?
Any concurrent-session limit blocking WS while REST works?
Can you check server-side logs for this key/IP around 23 Aug 2026 ~22:22 IST?
Running on REST quote fallback for now; need WS for live ticks. Happy to share redacted Squid logs / diagnostics (no secrets).

Thanks.
Sign In or Register to comment.