Websocket how? - page 17

 
Fedor Arkhipov:

On this site we can test the connection https://www.mql5.com/go?link=http%3A%2F%2Fwebsocket.org%2Fecho.html

i.e. we write in the form the address wss://api.huobi.pro/ws

and connection is made.

This means that we must also have a connection. Maybe that dude is using openSSL for a reason?

According to the standard, wss is analogous to https. It means that SSL is used, if the connection is made, we have to look at the protocol.

During the connection (handshake) there can be an exchange of keys (tokens) for authorisation, what is there about it in the documentation?

 
Дмитрий Прокопьев:

The standard is wss, which is analogous to https. I.e. SSL is used, if the connection happens, you need to look at the protocol further.

During connection (handshake) there may be exchange of keys (tokens) for authorisation, what is there about it in documentation?

I received a key, I can show it to you.

Here's what they write, but it's not for Websocket. But the most interesting thing is that the script on the website connects without problems

without any keys.


 

here


 
Mikhail Dovbakh:

There is a certain library in the marketplace.
For 4
and for 5 .

It seems that the ban on DLL calls for products from the marketplace has not been lifted yet, so I would not be so categorical.

The dll is there.

Updated free demo of Easy Websocket library can be downloaded from
https://drive.google.com/drive/folders/1QhL6NW5LXEWZCHHSYUyoodTUfR7zTJih

 
Mikhail Dovbakh:

hilarious.

Somehow...

 
Fedor Arkhipov:

here


Authorisation should be there whether websock or rest.

Pay attention to this one:

Dig into the documentation, or look for an example on how to use their websock

 
Дмитрий Прокопьев:

Authorisation must be there, whether websock or rest.

Pay attention to this:

You need to dig in the documentation, or look for an example on how to use their websock

Judging by this, some other id is used there as well:


//request
{
  "sub": "market.symbol.kline.period",
  "id": "id generate by client"
}
//request
{
  "sub": "market.ethbtc.kline.1min",
  "id": "id1"
}
 
Дмитрий Прокопьев:

Judging by this, some other id is used:


Here are some examples by the way:

https://github.com/huobiapi/Futures-Python-demo

huobiapi/Futures-Python-demo
huobiapi/Futures-Python-demo
  • huobiapi
  • github.com
Contribute to huobiapi/Futures-Python-demo development by creating an account on GitHub.
 
HuobiRDCenter/huobi_CSharp
HuobiRDCenter/huobi_CSharp
  • HuobiRDCenter
  • github.com
CSharp SDK for Huobi API. Contribute to HuobiRDCenter/huobi_CSharp development by creating an account on GitHub.
 

Since I work a lot with web sockets, I looked at their documentation, thankfully I know how to read documentation

1. MarketData streams do not require identification

2. However, they require a subscription through sending a put. In other words, immediately after connecting, no data is ping-ponged from the server.

3. All data (from the server) are compressed by GZ and require unpacking

ps/ id which the user sets is arbitrary, it is just for the user to figure out which request was answered