Websocket connection with glitch

Why is users are able to use collab room while other see this error
WebSocket connection to 'wss://needle-tiny-starter.glitch.me/socket index-d7be2e3b.js:1
failed

Hi Saad Baig,

The WebSocket connection failure you are experiencing on Glitch could happen for several reasons. Here are a few possibilities to consider:

  1. Server Load Limitations: Glitch has restrictions on the number of concurrent users (usually around 15-20). If this limit is exceeded, users may experience connection issues (see networking).

  2. Network Configuration: Ensure that your WebSocket server is configured correctly and is accessible from clients. The specified URL for the server (wss://needle-tiny-starter.glitch.me/socket) should be set up properly (see the documentation).

  3. Client Configuration: Some clients may not be able to connect due to configuration settings in the SyncedRoom component or networking settings. Ensure that parameters such as roomName and network events (like user joins) are configured properly (see networking) (see the documentation).

  4. Internet Connectivity: Check if all users have a stable internet connection required to maintain a WebSocket connection.

  5. Debugging Tools: Utilize debugging tools or console logs to gather more information on why the connection is failing. It can help identify issues like incorrect room names, failed event listeners, or problems during the connection phase (see the documentation) (see networking).

If you provide specific error messages or console output, I could assist you further in diagnosing the issue.

3 replies left
thread_AaZDVi3fCwC0mFpiyPl6uNGL
Reply to this message to continue the conversation

The most likely reason is that some of your users are trying to access the page without HTTPS and/or without a valid SSL certificate. Browsers have different restrictions on security for websockets – for example, Chrome will allow websocket connections with self-signed certificates, such as during development, while Safari will not.

In deployed pages with proper certificates that is not a problem, all browsers support Websockets over secure connections.

Store Lab | ShopTheLook
I’m doing internal testing with the team and everyone is using this link which is HTTPS on a windows pc. Either chrome or firefox.


this is what they see on joining room. While others have no issue joining.

The page looks nice!

Please ask them what browser(s) and versions they are using, and if they’re behind special firewalls or hardware. Also if you can show the full error instead of “Websocket error” that would be appreciated.


thats all that i see. They are using Chrome and its updated. Did you try the link?

Yes, I tried the link on multiple machines and networks here and it works everywhere.

Did you ask if there’s special hardware or firewalls involved that may prevent Websocket usage or accessing the networking server? Does networking work for them on https://needle-tiny-starter.glitch.me/ or any of our samples?

this links isn’t working for the person as well. They don’t have idea about any fiewalls restrictions. Can you guide me where to check if there’s any restrictions or not?

Typically you’ ask a network administrator. If entire links don’t work then there’s a firewall in place that prevents access to specific URLs.

Thanks a lot. It’s some house WIFI very strange why is there a restriction on it. I just checked it’s working on mobile data.

Thanks for confirming that it’s working on another network. House WiFi might come with default firewalls provided by the ISP, but we haven’t seen a case where our pages were blocked by that. Potentially the router disallows all use of websockets for some reason?

For advanced use you may want to use a custom location for the networking server (see @needle-tools/networking - npm). This way you have more control over bandwidth / server machine / firewall settings.

This topic was automatically closed 13 days after the last reply. New replies are no longer allowed.