实时推送

PushClient 使用 TCP+TLS、varint32 帧和 Protobuf。一个 Tiger ID 同时只能保持一个有效长连接;新连接可能踢出旧连接。

import { createClientConfig, PushClient } from '@tigeropenapi/tigeropen';

const client = new PushClient(createClientConfig());
client.setCallbacks({ onError: console.error });
await client.connect();
client.subscribeQuote(['AAPL']);

Did this page help you?