jswanner
ReqWebSocket - Req plugin adding WebSocket support
I’ve release ReqWebSocket, a Req plugin for establishing WebSocket connections, using Mint.WebSocket.
resp =
Req.new(connect_options: [protocols: [:http1]], into: :self)
|> ReqWebSocket.attach()
|> Req.get!(url: "wss://echo.websocket.org/")
{:ok, resp, [text: _text]} = ReqWebSocket.parse_message(resp, receive do m -> m end)
{:ok, resp} = ReqWebSocket.send_frame(resp, :ping)
{:ok, resp, [pong: ""]} = ReqWebSocket.parse_message(resp, receive do m -> m end)
The main benefits I see with using a Req plugin for making WebSocket requests have to do with being able to use Req’s request, response, and error steps for things like settings headers, following redirects, and performing retries. In addition to that, this library adds some conveniences regarding decoding & encoding WebSocket frames.
Popular in Announcing
This powerful library works together with Phoenix Router to provide the ultimate routing solution. It simplifies route manipulation, givi...
New
I’m falling in love with the Req Plugin pattern. It has limits, but when it works - it’s good.
I ported over my Tesla based Fly Machines...
New
An application wishing to store larger amounts of data typically has two options for doing so:
A new column on some table can be introd...
New
Hello Elixir community,
I work primarily on Java and other object oriented programming languages and often found it difficult to read an...
New
Hello Elixir community,
I’ve written a small embedded key-value database in Elixir called Goblin. It’s based on the Log-Structured Merge...
New
Once is an Ecto type for locally unique 64-bits IDs generated by multiple Elixir nodes. Locally unique IDs make it easier to keep things ...
New
Hello,
I’m excited to introduce InstructorLite – a fork of the Instructor package.
Instructor brought the very idea of structured LLM p...
New
Playfair (named after: William Playfair) is a data visualization/plotting library with the goal of being able to produce publication-qual...
New
Announcing ErrorTracker, an Elixir-based built-in error tracking solution.
Features
Basic, free, built-in error tracking solution. Trac...
New
Sifter is a a query filtering library for Ecto.
It lets frontend apps send human-readable query strings like:
"elixir phoenix status:pu...
New
Other popular topics
Update:
How to use the Blogs & Podcasts section
You can post links to your blog posts or podcasts either in one of the Official Blog...
New
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]
15:22:35.803 [error] gen_event {lager_file_backend...
New
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
can someone please explain to me how Enum.reduce works with maps
New
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode.
The solution seems to be, in a hyphena...
New
i’m a new one to elixir
which editor can i use
vs code? or atom?
Thanks! :smiley:
New
Hey,
Just curious what are the main benefits of Elixir compared to Clojure?
When is Elixir more useful than Clojure and vice versa?
Th...
New
Hey all,
I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
Hi everyone,
One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New







