aspen-cloud/triplit

Can't connect to https://console.triplit.dev/local with Safari or Brave

ninjaPixel opened this issue · 1 comments

Hey, folks! I'm just trying out Triplit, following the Quick Start. The client-side todo app is running and the local Triplit server is running (npx triplit dev), all looks good.

However, when I visit https://console.triplit.dev/local from Safari or Brave it's always "connecting" in the top left. There is a WebSocket error in the browser console. This seems to be a browser issue and can be fixed in Brave by turning off "shields" (I'm not sure what the Safari solution is).

I just thought I'd make you aware of this incase there is a way to surface a useful error message to the user in this situation.

Thanks for building such a cool product! ✌️

Brave:
Screenshot 2024-08-11 at 17 10 43

Shields down fixes it for Brave:
Screenshot 2024-08-11 at 17 18 19

Safari:
Screenshot 2024-08-11 at 17 15 34

Thanks for alerting us to this. The console app is served over HTTPS but attempts to connect to your local Triplit development server running on localhost:6543 over HTTP. This is an instance of mixed content, and is generally blocked by browsers. Localhost is usually treated as an exception to the rule and permitted, however, it is not allowed by default in either Safari or Brave. Caniuse table for additional reference.

As you've identified, you can disable the Brave shield, or, according to a blog they released, update your browser settings to put the console on a whitelist to allow content access from localhost. I haven't come across a workaround on Safari, which doesn't seem to offer these same configuration options. In the future we might look into making the /local endpoint configurable to connect over https/wss, which would involve the developer setting up HTTPS for local development.

Closing this for now.