-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Websocket error on Safari #169
Comments
Hi, thank you for the detailed issue. I haven't met problems so far, so I cannot share any meaningful configuration. I will try to debug it but no idea will I find something or not. |
Hi, thank you for your quick reply! package main
import (
"net/http"
"github.com/gobwas/ws"
"github.com/gobwas/ws/wsutil"
)
func main() {
http.ListenAndServe(":9090", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
conn, _, _, _ := ws.UpgradeHTTP(r, w)
defer conn.Close()
wsutil.WriteServerText(conn, []byte("ciao"))
}))
} On Safari console: ws = new WebSocket("ws://127.0.0.1:9090")
ws.onmessage = (msg) => console.log(msg.data) With Am I doing anything wrong? Thanks! |
More discussion about this with possible workarounds in uNetworking/uWebSockets#1347. As per the thread only "Safari 15.0-15.3" is affected and looks like 15.4 onwards works fine Some workarounds discussed there are,
If anybody gets to test any of these workarounds, please report here |
The example shown by @gabridego does not use compression. Also, I tested it on Safari 16.1 - and the error is still there. So I think those are two different Safari problems. |
I am developing a WebRTC service which uses your library for the signalling phase. Everything works well on Chrome, Firefox and Android, but I am experiencing an error on Safari (macOS Ventura 13.3) and iOS:
[Error] WebSocket connection to 'wss://myapp.com/ws' failed: The operation couldn’t be completed. Socket is not connected
Anyway, it works on Safari when disabling the experimental feature 'NSURLSession WebSocket', which makes me suspect of a possible issue with WebSocket compression. Some related issues:
Is there any configuration I can use to make my websocket application work on Safari and iOS as well? Thank you!
The text was updated successfully, but these errors were encountered: