53 words, 1 min read
⚠️ This post links to an external website. ⚠️
Reqplugin for establishing WebSocket connections, usingMint.WebSocket.resp =Req.new()|> ReqWebSocket.attach()|> Req.get!(into: :self, url: "wss://echo.websocket.org/")message = receive do message -> message end{:ok, resp, [text: _]} = ReqWebSocket.parse_message(resp, message){:ok, resp} = ReqWebSocket.send_frame(resp, :ping)message = receive do message -> message end{:ok, resp, [pong: ""]} = ReqWebSocket.parse_message(resp, message)
continue reading on github.com
If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts, subscribe use the RSS feed.