WebSocket Issues on Safari for iOS 26.2

0
5
Asked By CuriousCoder42 On

I'm developing a website that runs on my local network, which I access via the LAN IP of the machine using plain HTTP and WebSockets. However, I've encountered a problem with WebSockets on iOS 26.2 using Safari. It seems that the WebSocket doesn't even try to connect since its readyState shows 0, and tools like Wireshark confirm there's no connection attempt at all. Interestingly, sometimes dismissing Safari and reopening it makes it connect, and pressing the power button seems to trigger the connection as well. While refreshing the page allows a WebSocket connection to be established, it then closes immediately before a new one connects successfully after the page loads.

I've heard that disabling iCloud private relay could help with faulty HTTP CONNECT requests, but that doesn't seem to be the issue here since Wireshark indicates no attempts are made and it's connecting directly over WiFi. To add, I've tested other browsers like Firefox and Chrome on the same device, and they work flawlessly. Oddly enough, an iPad running Safari on version 18.7.3 works just fine. Has anyone else experienced similar connection issues?

2 Answers

Answered By CodeSlinger88 On

I actually ran into this problem on macOS recently after upgrading from Sequoia to Tahoe with Safari 26.2. It fails to connect on certain reload attempts. Oddly, having the web app open in at least two tabs seems to fix the connection failure. Everything else works fine on different browsers and older Safari versions.

TechWhiz19 -

Thanks for sharing your experience! Are you also working locally with non-secure WebSockets and HTTP? I can't help but wonder if secure WebSocket connections might not have the same issues. Could you check if the echo.websocket.org web app works for you? It seems to connect without a hitch for me.

Answered By WanderlustDev On

You might want to try a workaround by using a DNS solution like traefik.me, which can route through an IP address. I faced a similar issue, and this tweak really helped me out!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.