# Alpaca web sockets & Go Lang SDK

**URL:** <https://forum.alpaca.markets/t/alpaca-web-sockets-go-lang-sdk/9681>\
**Category:** Alpaca Integration Applications\
**Created:** [June 6, 2022, 8:03pm UTC](https://forum.alpaca.markets/t/alpaca-web-sockets-go-lang-sdk/9681 "2022-06-06T20:03:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xpolg](https://avatars.discourse-cdn.com/v4/letter/x/51bf81/32.png) [@Xpolg](https://forum.alpaca.markets/u/Xpolg)\
**Post date:** [June 6, 2022, 8:03pm UTC](https://forum.alpaca.markets/t/alpaca-web-sockets-go-lang-sdk/9681/1 "2022-06-06T20:03:08Z")

</div>

Hi,  
I’m using Go lang sdk v2.5.0 and can’t establish a socket connection. Following an example here [alpaca-trade-api-go/data\_stream.go at master · alpacahq/alpaca-trade-api-go · GitHub](https://github.com/alpacahq/alpaca-trade-api-go/blob/master/examples/data-stream/data_stream.go) but keep getting disconnected:

```auto
2022/06/06 14:59:21 INFO datav2stream: connecting to wss://stream.data.alpaca.markets/v2/sip, attempt 1/20 ...
2022/06/06 14:59:21 INFO datav2stream: established connection
2022/06/06 14:59:22 INFO datav2stream: finished connection setup
2022/06/06 14:59:22 INFO datav2stream: disconnected

```

Same when I specify a sandbox URL for streaming. Tried regenerating new API keys - same result. I should also mention that sockets work when I use an old version (1.9.0) of the SDK. But once I switch to the newest one - keep getting the errors above. What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![Xpolg](https://avatars.discourse-cdn.com/v4/letter/x/51bf81/32.png) [@Xpolg](https://forum.alpaca.markets/u/Xpolg)\
**Post date:** [June 10, 2022, 2:46am UTC](https://forum.alpaca.markets/t/alpaca-web-sockets-go-lang-sdk/9681/2 "2022-06-10T02:46:52Z")

</div>

anyone? Does Alpaca have support members browsing this forum here?

---

<div class="post-metadata">

**Author:** ![Gravitas](https://avatars.discourse-cdn.com/v4/letter/g/51bf81/32.png) [@Gravitas](https://forum.alpaca.markets/u/Gravitas)\
**Post date:** [June 10, 2022, 7:56am UTC](https://forum.alpaca.markets/t/alpaca-web-sockets-go-lang-sdk/9681/3 "2022-06-10T07:56:43Z")

</div>

Are you on the free market data stream or the paid ($9/month)?

---

<div class="post-metadata">

**Author:** ![Xpolg](https://avatars.discourse-cdn.com/v4/letter/x/51bf81/32.png) [@Xpolg](https://forum.alpaca.markets/u/Xpolg)\
**Post date:** [June 13, 2022, 3:58am UTC](https://forum.alpaca.markets/t/alpaca-web-sockets-go-lang-sdk/9681/4 "2022-06-13T03:58:15Z")

</div>

I’m on the paid account. And it works fine with the old version of the sdk (v1.9.0), but just keeps disconnecting when I switch to the new one. I tried regenerating the API keys for both live and paper account - didn’t help. Debugged and made sure the API keys are actually being used as well, so I don’t think it’s that.

---

<div class="post-metadata">

**Author:** ![masjaya.sutarno](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/masjaya.sutarno/32/3364_2.png) [@masjaya.sutarno](https://forum.alpaca.markets/u/masjaya.sutarno)\
**Post date:** [June 14, 2022, 10:35am UTC](https://forum.alpaca.markets/t/alpaca-web-sockets-go-lang-sdk/9681/5 "2022-06-14T10:35:28Z")

</div>

Hi @Xpolg

can you give me a little more context on the situation? When did this issue begin happening? Has it been occurring consistently, or does it happen on and off? could you try to get all packages from [here](https://pkg.go.dev/github.com/alpacahq/alpaca-trade-api-go/v2@v2.5.0/marketdata/stream#section-sourcefiles) and it would be great to find a more personalized solution I suggest sending the email to support@alpaca.markets
