alpacahq / alpacahq/alpaca-trade-api-go

Broken Stream Client Connection

Aperta
#300 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Go
Stelle
429
Fork
118
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.