Skip to content

Commit

Permalink
Merge pull request #27 from fstp/fix_stream_auth
Browse files Browse the repository at this point in the history
Fix Alpaca websocket authentication procedure
  • Loading branch information
jrusso1020 authored Sep 24, 2024
2 parents 9407de9 + fba3e76 commit 33e4814
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/alpaca/stream.ex
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ defmodule Alpaca.Stream do
end
```
"""
def start_link(streams) do
{:ok, pid} = WebSockex.start_link(unquote(url), __MODULE__, :no_state)
def start_link(streams, opts \\ []) do
{:ok, pid} = WebSockex.start_link(unquote(url), __MODULE__, :no_state, opts)
authenticate(pid)

unless streams == [] do
Expand Down Expand Up @@ -152,10 +152,8 @@ defmodule Alpaca.Stream do
authentication_json =
%{
action: "auth",
data: %{
key: Client.client_id(),
secret: Client.client_secret()
}
key: Client.client_id(),
secret: Client.client_secret()
}
|> Jason.encode!()

Expand Down

0 comments on commit 33e4814

Please sign in to comment.