You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to connect to Supabase Edge Function via WebSocket.
I managed to connect to the Edge Function locally and even when I expose the local instance of the Function to the internet I can connect to it from outside.
But as soon as I Deploy the function to a Supabase Project The WebSocket Connection fails.
I am not sure if it's a Bug or it's not supported.
To Reproduce
Create a Supabase function using the CLI: Supabase functions new ws
Up to this Step if you started the function using supabase functions serve --no-verify-jwt and opened a WebSocket connection to the local instance of the edge-runtime, it will work just fine. The Bug is in the Next Step.
Deploy the Function using CLI: supabase functions deploy ws --no-verify-jwt.
Try to connect to the function via the Webbrowser or using https://websocketking.com/, it will fail as it can't connect, but in the logs of the function you will findout that the socket opens and immediately errors out then closes with an error message 'Unexpected EOF'
Expected behavior
It Should work in Supabase Projects as it's working in the local runtime.
Screenshots
The local CLI instance Working Properly.
The log in the Dashboard showing the failure.
System information
OS: Linux Arm64
Browser: Edge
Version of supabase-cli: v1.157.2
Version of Node.js: v18.20.2
Additional context
My Reference is this Official Video which referenced this article from Deno.
I Duplicated the Video for the Server-Side-Events, and it works as Expected both locally and on Supabase Projects.
The video talks about WebSockets briefly but does not implement it.
The text was updated successfully, but these errors were encountered:
Yes, it is currently not supported in Supabase cloud as Websockets are not enabled on the underlying provider. Will change this to an enhancement and @laktek can comment more if any progress is made
I agree this feature would be awesome.
Hey @laktek, do you have any estimation for it?
I'd like to use this feature to implement this feature
Sadly, I posted this like a year ago and no one noticed. So, I am trying to implement it myself.
Bug report
Describe the bug
I am trying to connect to Supabase Edge Function via WebSocket.
I managed to connect to the Edge Function locally and even when I expose the local instance of the Function to the internet I can connect to it from outside.
But as soon as I Deploy the function to a Supabase Project The WebSocket Connection fails.
I am not sure if it's a Bug or it's not supported.
To Reproduce
Create a Supabase function using the CLI:
Supabase functions new ws
Use This code is based on this article from Deno:
Up to this Step if you started the function using
supabase functions serve --no-verify-jwt
and opened a WebSocket connection to the local instance of the edge-runtime, it will work just fine. The Bug is in the Next Step.Deploy the Function using CLI:
supabase functions deploy ws --no-verify-jwt
.Try to connect to the function via the Webbrowser or using https://websocketking.com/, it will fail as it can't connect, but in the logs of the function you will findout that the socket opens and immediately errors out then closes with an error message 'Unexpected EOF'
Expected behavior
It Should work in Supabase Projects as it's working in the local runtime.
Screenshots
The local CLI instance Working Properly.
The log in the Dashboard showing the failure.
System information
Additional context
My Reference is this Official Video which referenced this article from Deno.
I Duplicated the Video for the Server-Side-Events, and it works as Expected both locally and on Supabase Projects.
The video talks about WebSockets briefly but does not implement it.
The text was updated successfully, but these errors were encountered: