mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[GH-ISSUE #24207] issue: Safari cannot establish WebSocket on 0.9.2 (direct port, no reverse proxy) #58896
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @josemodena on GitHub (Apr 28, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/24207
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.9.2
Ollama Version (if applicable)
No response
Operating System
macOS 26
Browser (if applicable)
Safari 26.3.1 (fails); Chrome (works)
Confirmation
README.md.Expected Behavior
On Safari (macOS), sending a chat message in OpenWebUI should render the assistant's reply in the chat bubble, just as it does in Chrome on the same machine.
Actual Behavior
On Safari (macOS 26.3.1), the assistant chat bubble stays empty after submitting a message. The HTTP chat-completion request returns 200 OK and the streamed chunks are visible in the Network tab, so the response is reaching the browser, but it never renders. The same instance works fine in Chrome on the same machine.
The browser console shows that the Socket.IO WebSocket fails:
A direct WebSocket upgrade to the same URL via curl returns
HTTP/1.1 101 Switching Protocolsand the Engine.IO handshake, so the server side is healthy. The failure is in Safari's handling of the Socket.IO handshake, or in an interaction between the OpenWebUI 0.9.2 Socket.IO server and Safari specifically.Workaround: setting
ENABLE_WEBSOCKET_SUPPORT=falseon theopen-webuiservice forces Socket.IO to fall back to long polling. Safari then renders responses correctly.Steps to Reproduce
main-slimimage on a host with Docker. Reported digest:sha256:31b9870915ab83af3c2b9e54559cf09fca33a35822c38547a33e73ed072fb9b1(version v0.9.2). Host in this report is Synology DSM, but any Docker host should reproduce.0.0.0.0:8282 -> 8080/tcp. Reach the container directly from a browser, no reverse proxy./v1/chat/completionsreturns 200 with valid streamed chunks.hi.data: ...chunks.ENABLE_WEBSOCKET_SUPPORT=false. Force redeploy the container so the new env var takes effect (a plain restart did not pick it up in our test).Logs & Screenshots
Browser console (Safari 26.3.1)
Network tab in Safari shows the chat-completion POST returning 200 OK and well-formed
data: {...}SSE chunks ending indata: [DONE]. The same chunks render correctly in Chrome.Server-side WebSocket upgrade is healthy
A direct WebSocket upgrade to the same URL via curl succeeds and returns a valid Engine.IO handshake:
Note
"upgrades":[]in the handshake. The request asked fortransport=websocket, the server accepted, but it reports no further upgrade options. This is plausibly relevant to Safari's stricter handshake handling.OpenWebUI container logs
Nothing unusual at startup or during the failing request. The container accepts the chat-completion POST and returns 200. The WebSocket upgrade attempt from Safari does not surface any error in the container logs (no exception, no rejection trace), which is consistent with Safari closing the socket from the client side.
Backend (LiteLLM) is healthy and not implicated
LiteLLM
/healthreturnshealthy_count: 3, unhealthy_count: 0for all configured models./v1/chat/completionswithstream:truereturns valid SSE chunks. Backend choice is not the cause; the same Safari instance fails to render even when the backend response is verified valid.Additional Information
Workaround
Adding
ENABLE_WEBSOCKET_SUPPORT=falseto the OpenWebUI service forces Socket.IO to long-polling and resolves the issue in Safari. A force redeploy is required, a plain restart did not pick up the new env var in our test.Suggested investigation
The Engine.IO handshake response includes
"upgrades":[], which is unusual when the request asked fortransport=websocket. Worth checking how the Socket.IO server is initialised (async_mode,transports) and whether theengineioandpython-socketioversions in the slim image at this digest interact differently with Safari than with Chrome. Chrome on the same machine, same OpenWebUI instance, same backend works fine.Related prior reports
Not exact matches, but Safari plus Socket.IO has been a recurring weak spot:
SyntaxError: The string did not match the expected pattern.)Setup detail
sk-...string, stored in Portainer env vars on the LiteLLM container. Not relevant to the Safari rendering bug.http://192.168.0.3:8282.@Classic298 commented on GitHub (May 1, 2026):
Codebase looks fine, nothing Safari-specific stands out. The
"upgrades":[]is a red herring: server and client are both pinned totransports: ['websocket'](no polling at all), so there is nothing to upgrade to. That is also whyENABLE_WEBSOCKET_SUPPORT=falsefixes it, it flips both sides to polling.Before this gets chased as an Open WebUI bug, can you narrow it down?
2.1 Same task but with different Safari versions.
ws://192.168.0.3:<port>echo server (e.g. websocat) connect, or fail the same way? That isolates WebKit-on-LAN-ws vs. Open WebUI.http://localhost:8282from Safari on the Docker host itself fail the same way?Also useful: the full Safari Web Inspector entry for the failing WS (request and response headers,Sec-WebSocket-Protocol,Sec-WebSocket-Extensions), and the exact macOS build.Quick one line test on your side: in
src/routes/+layout.svelte:122change['websocket']to['polling', 'websocket']and see if Safari connects via polling and then upgrades, or connects via polling and fails to upgrade. That tells us if WebKit hates the WS frame itself or just the no-handshake direct-WS path.