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

Broken Stream Client Connection #300

Open
nmoniz opened this issue Sep 4, 2024 · 1 comment
Open

Broken Stream Client Connection #300

nmoniz opened this issue Sep 4, 2024 · 1 comment

Comments

@nmoniz
Copy link

nmoniz commented Sep 4, 2024

I was trying out the SDK and I found an issue while testing the crypto stream and the data stream examples. The issue may be with the actual stream.CryptoClient / stream.StocksClient and how it tries to connect.

When I called the Connect(...) method I got the following error:

datav2stream: irrecoverable error: websocket dial: failed to WebSocket dial: expected handshake response status code 101 but got 404

The key to fixing it was in the log line immediately before:

datav2stream: connecting to wss://paper-api.alpaca.markets/stream/us, attempt 1/20 ...

The /us shouldn't be there.

I was able to get around this error by creating the clients with marketdata.Feed("") for the first param. This way I got a log:

datav2stream: established connection
@gnvk
Copy link
Collaborator

gnvk commented Sep 16, 2024

Hi! paper-api.alpaca.markets is definitely the wrong URL both for stream.CryptoClient and for stream.StocksClient. If you provide a minimal reproducible example I can help you fix it.

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