dlang-requests icon indicating copy to clipboard operation
dlang-requests copied to clipboard

Support of Websocket

Open andre2007 opened this issue 4 years ago • 3 comments

Both, libcurl and Vibe.d supports websocket. It would be great if you could add Websocket support to requests.

  • https://phpandmore.net/2015/02/17/implementing-web-sockets-with-curl/
  • https://github.com/barbieri/barbieri-playground/blob/master/curl-websocket/curl-websocket.c

andre2007 avatar Feb 22 '21 11:02 andre2007

Hello @andre2007

It would be interesting. I never looked at websocket, so I have to investigate

ikod avatar Feb 22 '21 16:02 ikod

Hello @andre2007

I looked a bit into this topic. Looks like websocket is essentially async protocol, it should use some event loop to operate. Right now I'm not sure how to integrate requests with event loop framework.

ikod avatar Mar 05 '21 10:03 ikod

Hello @ikod Yes, I assume this is the difficult part. Adam also has Websockets in his implementation (based on his own http implementation instead of curl). https://www.github.com/adamdruppe/arsd/tree/master/http2.d Maybe you can look here how he has solved the event loop problem.

andre2007 avatar Mar 05 '21 10:03 andre2007