userver-framework / userver

Production-ready C++ Asynchronous Framework with rich functionality
https://userver.tech
Apache License 2.0
2.44k stars 289 forks source link

Websockets client #399

Open apolukhin opened 1 year ago

apolukhin commented 1 year ago

Make sure that the HTTP Client is usable for websockets, add the missing functionality if it is not. Add tests.

Internal ticket: 7503

Turim commented 4 months ago

I'm not sure what's the topic. Is it either Websocket readiness itself or Websocket vs (idk) Http Client compatibility?

Imo it looks good (it basically works (e.g. explicitly tested by wscat). it works even with TLS), but it lacks flexibility, which clients may intend to develop themselves. For instance, it supposed to be bi-directional, but currently (meaning github's v2.[1-2]) client should reinvent the wheel and re-write it to some extent deeply, e.g. switching to (other wrappers around) non-blocking recv().

May be I'd have written some proposal , but I can't figure out the merge policy. I have seen several approved PRs, which hasn't been merged yet. From this PoV it looks like dead-PRs/dead code (=> time waste).

upd. still applicable to 2.2 though.

upd2. Some flexibility have been added, tnx #661

Turim commented 3 months ago

Actually today there are some tests, samples (but, frankly speaking, I expected full duplex to be present in samples also).

Is the issue relevant still?

apolukhin commented 2 months ago

The issues is relevant: we have samples for websockets server, but there's no example of how to create a websocket connection from userver (C++ code) to the websocket server.

I expected full duplex to be present in samples also Yes, This should be done some day