Skip to content

fix(okx): use port 443 for OKX websocket streams - #344

Merged
brokermr810 merged 1 commit into
OpenByteInc:mainfrom
patrickballard:fix/okx-ws-port-443
Nov 4, 2026
Merged

brokermr810 merged 1 commit into
OpenByteInc:mainfrom
patrickballard:fix/okx-ws-port-443

Conversation

@patrickballard

Copy link
Copy Markdown
Contributor

Summary

OKX is retiring WebSocket port 8443 (OKX v5 changelog; ccxt/ccxt#30715 and hummingbot/hummingbot#8525 make the same switch). Connections on 8443 still open, but the first frame OKX sends on them is {"event":"notice","msg":"WebSocket port 8443 will be retired soon. Please migrat…"}. This switches QuantDinger's OKX streams to the default port 443.

Related issue

  • None. It's a small fix found while making the same change in other OKX clients.

Changes

  • app/services/market_price_stream.py: the OKX public price feed URL is now wss://ws.okx.com/ws/v5/public.
  • app/services/execution_streams/adapters.py: the OkxExecutionAdapter private URL is now wss://ws.okx.com/ws/v5/private (live) and wss://wspap.okx.com/ws/v5/private (demo).
  • Tests: test_okx_demo_and_live_use_port_443_private_websocket_hosts (same style as the Bitget host test) and test_okx_public_price_feed_uses_port_443_websocket[spot|swap].

Test plan

  • Tested locally with docker compose up -d --build: not done; I didn't run the full stack
  • Relevant pytest tests pass: tests/test_execution_stream_adapters.py tests/test_market_price_stream.py give 42 passed, with deps installed as in basic-ci.yml (requirements.lock --no-deps plus requirements-dev.txt). With the old URLs, the 3 new tests fail.
  • ruff check on the changed files passes
  • Live check: wss://ws.okx.com/ws/v5/public, wss://ws.okx.com/ws/v5/private and wss://wspap.okx.com/ws/v5/private all answer ping with pong on port 443. A login on each private host is processed (60005 Invalid apiKey for a fake key). I didn't test with real credentials.

🤖 Generated with Claude Code

OKX is retiring websocket port 8443; connections on it already receive
"WebSocket port 8443 will be retired soon". Switch the public price feed
and the private execution stream (live and demo) to the default port, and
pin the okx urls in the stream tests like the other exchanges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Paddy <89168564+patrickballard@users.noreply.github.com>
@codecov

codecov Bot commented Nov 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@sonarqubecloud

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

@brokermr810
brokermr810 merged commit dd90b83 into OpenByteInc:main Nov 4, 2026
2 checks passed
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.

2 participants