Hi, thanks for the library!
I’m having some trouble starting the websocket connection.
defmodule Mymodule.Protocol.Websocket do
use Fresh
def start_link() do
__MODULE__.start_link(
uri: "wss://ws.kraken.com",
state: %{},
opts: [
name: {:local, :consumer_1}
]
)
end
end
and this is the response I receive:
{:ok, #PID<0.229.0>}
** (EXIT from #PID<0.228.0>) shell process exited with reason: an exception was raised:
** (FunctionClauseError) no function clause matching in Mint.HTTP1.request/5
(mint 1.5.1) lib/mint/http1.ex:251: Mint.HTTP1.request(%Mint.HTTP1{host: "ws.kraken.com", port: 443, request: nil, streaming_request: nil, socket: {:sslsocket, {:gen_tcp, #Port<0.7>, :tls_connection, :undefined}, [#PID<0.238.0>, #PID<0.237.0>]}, transport: Mint.Core.Transport.SSL, mode: :active, scheme_as_string: "https", requests: {[], []}, state: :open, buffer: "", proxy_headers: [], private: %{scheme: :wss, extensions: [], sec_websocket_key: "BjILFTs2jHw7qAt9C6CftQ=="}, log: false}, "GET", nil, [{"upgrade", "websocket"}, {"connection", "upgrade"}, {"sec-websocket-version", "13"}, {"sec-websocket-key", "BjILFTs2jHw7qAt9C6CftQ=="}], nil)
(fresh 0.4.2) lib/fresh/connection.ex:92: Fresh.Connection.disconnected/3
(stdlib 5.1.1) gen_statem.erl:1377: :gen_statem.loop_state_callback/11
(stdlib 5.1.1) proc_lib.erl:241: :proc_lib.init_p_do_apply/3
As I can see it actually starts the process but dies immediately after.
I’m using Elixir 1.15.5.