# WebSocket Backend supported? Status 503

**URL:** <https://community.firebasestudio.dev/t/websocket-backend-supported-status-503/390>\
**Category:** General\
**Created:** [May 31, 2024, 1:02pm UTC](https://community.firebasestudio.dev/t/websocket-backend-supported-status-503/390 "2024-05-31T13:02:04Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![felixge0](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/felixge0/32/343_2.png) [@felixge0](https://community.firebasestudio.dev/u/felixge0)\
**Post date:** [May 31, 2024, 1:02pm UTC](https://community.firebasestudio.dev/t/websocket-backend-supported-status-503/390/1 "2024-05-31T13:02:04Z")

</div>

Is it possible to use WebSockets with the backend ports?

I’m currently trying to connect to a WebSocket hosted by a Node.js IDX project from a Flutter IDX project. However, I’m encountering an issue where the connection gets instantly disconnected. The backend does register that the client was connected, but only for a brief moment.

Additionally, when I attempt to connect using Insomnia/Postman from my laptop, I receive a “503 Service Unavailable” error and experience the same behaviour.

Could this indicate that WebSockets are not yet supported, or is there another potential issue at play here?

Any insights or solutions would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Sunny](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/sunny/32/85_2.png) [@Sunny](https://community.firebasestudio.dev/u/Sunny)\
**Post date:** [May 31, 2024, 3:20pm UTC](https://community.firebasestudio.dev/t/websocket-backend-supported-status-503/390/2 "2024-05-31T15:20:32Z")

</div>

I think it is because the all hosted server on IDX require authentication of some sort, check this comment out.

> [@Can't test Stripe with IDX since there is a redirect on the public URLs IDX uses](https://community.firebasestudio.dev/t/cant-test-stripe-with-idx-since-there-is-a-redirect-on-the-public-urls-idx-uses/282/2):
>
> Hi @treeder , iiuc the reason you see a redirect is because IDX does not support unauthenticated http(s) access to services running on your IDX workspace. To make it work you will have to configure stripe webhook url by adding an access token query parameter to the webhook url, e.g. like the following: 1234-workspace-domain.cloudworkstations.dev/some/path?\_workstationAccessToken=\<ACCESS\_TOKEN\>. To get the access token, please read this [blog post](https://idx.dev/blog/article/full-stack-development-in-project-idx#:~:text=Server%2Dside%20testing%20without%20a%20login). Namely you can generate it by running the “Gene…

---

<div class="post-metadata">

**Author:** ![felixge0](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/felixge0/32/343_2.png) [@felixge0](https://community.firebasestudio.dev/u/felixge0)\
**Post date:** [May 31, 2024, 7:13pm UTC](https://community.firebasestudio.dev/t/websocket-backend-supported-status-503/390/3 "2024-05-31T19:13:20Z")

</div>

Thanks for the reply. The answer seems to be a bit older.  
I tried the access token as bearer like described in the updated blog post but I‘m still ending in a 503

---

<div class="post-metadata">

**Author:** ![Sunny](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/sunny/32/85_2.png) [@Sunny](https://community.firebasestudio.dev/u/Sunny)\
**Post date:** [May 31, 2024, 7:18pm UTC](https://community.firebasestudio.dev/t/websocket-backend-supported-status-503/390/4 "2024-05-31T19:18:01Z")

</div>

May I ask what … library? module? you used to create a websocket on Node.js (sorry, not too well-versed in js)

---

<div class="post-metadata">

**Author:** ![felixge0](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/felixge0/32/343_2.png) [@felixge0](https://community.firebasestudio.dev/u/felixge0)\
**Post date:** [May 31, 2024, 8:25pm UTC](https://community.firebasestudio.dev/t/websocket-backend-supported-status-503/390/5 "2024-05-31T20:25:59Z")

</div>

I‘ve got the whole code here: [Hastebin](https://hastebin.com/share/ramusokefo.typescript)

The libary is „ws“ [ws - npm](https://www.npmjs.com/package/ws)

---

<div class="post-metadata">

**Author:** ![Sunny](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/sunny/32/85_2.png) [@Sunny](https://community.firebasestudio.dev/u/Sunny)\
**Post date:** [May 31, 2024, 10:18pm UTC](https://community.firebasestudio.dev/t/websocket-backend-supported-status-503/390/6 "2024-05-31T22:18:35Z")

</div>

Sorry, I have no idea. But have you considered using `WebSocketServer` instead?  
Check the examples in

> **[GitHub - websockets/ws: Simple to use, blazing fast and thoroughly tested...](https://github.com/websockets/ws)**
>
> Simple to use, blazing fast and thoroughly tested WebSocket client and server for Node.js - websockets/ws

---

<div class="post-metadata">

**Author:** ![felixge0](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/felixge0/32/343_2.png) [@felixge0](https://community.firebasestudio.dev/u/felixge0)\
**Post date:** [June 3, 2024, 11:58am UTC](https://community.firebasestudio.dev/t/websocket-backend-supported-status-503/390/7 "2024-06-03T11:58:14Z")

</div>

I have now started the entire code once locally and was able to access it without any problems. I have tried to IDX both the access token as URL parameter and also as bearer token but got no result except a 503.

So the websocket server implementation is not the problem.

---

<div class="post-metadata">

**Author:** ![KELLOU\_Abdelghani](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/kellou_abdelghani/32/4145_2.png) [@KELLOU\_Abdelghani](https://community.firebasestudio.dev/u/KELLOU_Abdelghani)\
**Post date:** [January 31, 2025, 2:16pm UTC](https://community.firebasestudio.dev/t/websocket-backend-supported-status-503/390/8 "2025-01-31T14:16:12Z")

</div>

hi I’m facing the same issue now and I was wondering if you did find a solution

---

<div class="post-metadata">

**Author:** ![Safak\_Senal](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/safak_senal/32/3693_2.png) [@Safak\_Senal](https://community.firebasestudio.dev/u/Safak_Senal)\
**Post date:** [July 1, 2025, 8:52pm UTC](https://community.firebasestudio.dev/t/websocket-backend-supported-status-503/390/9 "2025-07-01T20:52:53Z")

</div>

The problem still persists. Have you solved it sir?
