【问题标题】:Connect to Lightstremer with Python for IG API streaming使用 Python 连接到 Lightstremer 以进行 IG API 流式传输
【发布时间】:2023-02-15 18:46:54
【问题描述】:

我正在尝试连接到 Lightstremer 以使用 IG API 流式传输,并且我想使用 websockets 库。 我想知道是否有可能。 我苦苦挣扎的是如何获取用于创建与服务器的连接的 URI。 我可以从 IG 获取 lightstreamer 端点,它看起来像“http://demo-apd.marketdatasystem.com”。

如果我跑

import websockets
import asyncio

ws_url = 'http://demo-apd.marketdatasystem.com/lighstreamer'
connection = await websockets.connect(ws_url)

我收到错误 https://demo-apd.marketdatasystems.com/lighstreamer isn't a valid URI

如果我更改下面的代码

ws_url = 'wss://demo-apd.marketdatasystem.com/lighstreamer'
connection = await websockets.connect(ws_url)

我有一条连接失败的消息

谢谢你的时间

【问题讨论】:

    标签: python api websocket


    【解决方案1】:

    认为您需要使用 Lightstreamer 客户端而不是 WebSockets。据我了解,它们是两种不同的协议。

    来自 Lightstreamer 的官方 Python 客户端 - https://sdk.lightstreamer.com/ls-python-client/1.0.1/api/intro.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-03-16
      • 2017-11-10
      • 1970-01-01
      • 2021-09-06
      • 1970-01-01
      • 1970-01-01
      • 2013-09-24
      • 1970-01-01
      相关资源
      最近更新 更多