E
E
Eugene2019-02-16 21:32:50
In contact with
Eugene, 2019-02-16 21:32:50

How to use http2 to work with Bots Longpoll?

There was an idea to use not the standard https.request, but http2 to receive Bots Longpoll API VK events. Since the https connection is terminated immediately after receiving the event, it takes time to establish a new one. Http2 allows you to create a persistent connection and make multiple simultaneous requests/responses on the same connection.
Nodejs has support for Http2 , but I could not find a clear explanation of how to use it to work with the VK API.
Let's say a response has already been received with connection data

{ key: 'KEY',
  server: 'https://lp.vk.com/SERVET',
  ts: 1 }

What needs to be done next?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Puma Thailand, 2019-02-17
@opium

Using http2 will not solve your problems.
There is more problem in the hands than in the choice of protocol

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question