websocket-client icon indicating copy to clipboard operation
websocket-client copied to clipboard

Same request with websocket python library works but not working with websocket-client

Open zenconix opened this issue 2 years ago • 2 comments

Hi there, I am trying to get data from broker. I tried with python's "websocket" library and it works, here is screen capture of python's implementation. image

But when I try to use same request with this library, I am just receiving ping-pong data, not receiving actual data as below image

I tried to check in Fiddler, it shows Ping-Pong messages but not receiving actual data from server. image

zenconix avatar Jan 04 '23 16:01 zenconix

Hey @zenconix ,

are the sent messages identical in Fiddler?

Did you configure the same headers as it is in Python?

using var communicator = new WebsocketClient(url, () =>
{
    var client = new ClientWebSocket();
    client.Options.SetRequestHeader("Origin", "http://stream.stocknote.com:443");
    client.Options.SetRequestHeader("Sec-WebSocket-Key", "XqTD...");
    return client;
});

Marfusios avatar Feb 21 '23 10:02 Marfusios

微软的System.Net.WebSocket是有bug的库。

xylo987 avatar Apr 07 '23 06:04 xylo987