I have gotten past the issue by having init/1. Though I am curious about reduction in number of params.
Now I am facing issues with sending messages over WS. Can anyone point out as to what I am missing? Below is the iex session. How do I send messages over the established WS connection?
iex(2)> {:ok, sock} = :websocket_client.start_link('ws://
echo.websocket.org', WsApp, self, [])
{:ok, #PID<0.99.0>}
iex(3)> send sock, {:send, {:text, 'whatsup'}}
** (EXIT from #PID<0.88.0>) :undef
Interactive Elixir (1.0.5) - press Ctrl+C to exit (type h() ENTER for help)
19:45:40.504 [error] ** Websocket client WsApp terminating in :websocket_info/3
for the reason :error::undef
** Last message was {:send, {:text, 'whatsup'}}
** Handler state was #PID<0.88.0>
** Stacktrace: [{WsApp, :websocket_info,
[{:send, {:text, 'whatsup'}},
:undefined,
{:transport, :gen_tcp, :tcp, :tcp_closed, :tcp_error,
[:binary, {:active, true}, {:packet, 0}]}, "AKJnDy6AfmlQBu4FLWBxHg==",
:undefined, :undefined, :undefined, :undefined, :undefined}, #PID<0.88.0>],
[]},