safari websocket
When have multiple trackers,Only the first tracker will be loaded,The rest will not load. mac safari and ios safari has this problem.
mac safari version: 17.6
source code: ` this.client = new TrackerClient({ infoHash: utf8ToUintArray(streamHash), peerId: utf8ToUintArray(peerId), announce: isSafariOrWkWebview() ? config.announceTrackers.slice(0, 1) // Safari has issues with multiple trackers : config.announceTrackers, rtcConfig: this.config.rtcConfig, });
`
modify source code:
`
this.client = new TrackerClient({ infoHash: utf8ToUintArray(streamHash), peerId: utf8ToUintArray(peerId), announce: isSafariOrWkWebview() ? config.announceTracker : config.announceTrackers, rtcConfig: this.config.rtcConfig, });
` After testing, it can be used normally even with multiple trackers. I want to know why it cannot be used normally.
Unfortunately, there is a bug in Safari: it closes WebSocket connections with large messages.
https://bugs.webkit.org/show_bug.cgi?id=228296
Fortunately, there is no this bug if only one WebSocket connection is open.
You can find the issue:
- https://discussions.apple.com/thread/253391452?sortBy=rank
- https://forums.developer.apple.com/forums/thread/695769
- https://forums.macrumors.com/threads/safari-cant-open-the-page-the-error-is-the-operation-couldnt-be-completed-no-space-left-on-device.2384934/
It is how it looks for us:
We can't reproduce the issue in the latest Safari 18 but are still testing it.
I found that Safari will close web socket connection as default. (Ref: https://www.reddit.com/r/MacOS/comments/qna5js/safari_issue_in_monterey/)
I Google and found that 'disable websocket compression to fix macos monterey safari' but I'm not sure how can I do. I use wt-tracker as tracker
(ref: https://github.com/tilt-dev/tilt/pull/5082)
Overall, this is a Safari issue. You can try disabling compression in wt-tracker using this option: https://github.com/Novage/wt-tracker/blob/1c6dc5e5b6b3f48b392e7bb77b0c12e57ab5ca76/README.md?plain=1#L62