尊敬的XT用户:
业务 | 接入地址 |
|---|---|
现货公共行情 | wss://stream.xt.com/public |
合约公共行情 | wss://fstream.xt.com/ws/market |
语言 / 库 | 开启方式 |
|---|---|
Python websockets | 默认已开启,无需修改 |
Python aiohttp | session.ws_connect(url, compress=15)(默认不开启,需修改) |
Python websocket-client | 不支持压缩,请更换为 websockets 或 aiohttp |
Node.js ws / 内置 WebSocket | 默认已开启,无需修改 |
Go gorilla/websocket | websocket.Dialer{EnableCompression: true} |
Java Netty | 在 pipeline 中添加 WebSocketClientCompressionHandler.INSTANCE |
C Boost.Beast | permessage_deflate opt; opt.client_enable = true; ws.set_option(opt); |
浏览器 | 默认已开启,无需修改 |
Sec-WebSocket-Extensions: permessage-deflate,即表示已启用压缩,无需进一步操作。