Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error to connect ssl sockets with a CRLF json protocol #83

Open
klevison opened this issue Apr 27, 2020 · 1 comment
Open

Error to connect ssl sockets with a CRLF json protocol #83

klevison opened this issue Apr 27, 2020 · 1 comment

Comments

@klevison
Copy link

I'm trying to connect to a socket (ssl)

defmodule WebSocketExample do
  use WebSockex

  def start_link(url, state) do
    WebSockex.start_link(url, __MODULE__, state)
  end

  def handle_frame({type, msg}, state) do
    IO.puts("Received Message - Type: #{inspect(type)} -- Message: #{inspect(msg)}")
    {:ok, state}
  end

  def handle_cast({:send, {type, msg} = frame}, state) do
    IO.puts("Sending #{type} frame with payload: #{msg}")
    {:reply, frame, state}
  end
end
WebSocketExample.start_link "wss://stream-api.betfair.com", :state

But it returns {:error, %WebSockex.ConnError{original: :closed}}

What is wrong with my code?

@Azolo
Copy link
Owner

Azolo commented May 4, 2020

That's usually an SSL error of some sort.

I haven't had time to give this library the attention it deserves, but I'll see if I can make SSL easier to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants