gcarq / inox-patchset

Inox patchset tries to provide a minimal Chromium based browser with focus on privacy by disabling data transmission to Google.
BSD 2-Clause "Simplified" License
364 stars 26 forks source link

WebSocket connection issues #112

Closed xsmile closed 6 years ago

xsmile commented 6 years ago

This latest version 62.0.3202.62-1 broke a bunch of sites for me. Discord voice chat, twitch text chat.

When I try to write in discord text chat I get this: worker-cc6cefad358a964412c188043046809c.js:1 Uncaught (in promise) DOMException: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state. at https://static.twitchcdn.net/assets/worker-cc6cefad358a964412c188043046809c.js:1:25868 at new Promise () at e.u._sendMessage (https://static.twitchcdn.net/assets/worker-cc6cefad358a964412c188043046809c.js:1:25536) at e.say (https://static.twitchcdn.net/assets/worker-cc6cefad358a964412c188043046809c.js:1:51525) at e.say (https://static.twitchcdn.net/assets/worker-cc6cefad358a964412c188043046809c.js:1:38955) at e.maybeSay (https://static.twitchcdn.net/assets/worker-cc6cefad358a964412c188043046809c.js:1:45105) at e.messageHandler (https://static.twitchcdn.net/assets/worker-cc6cefad358a964412c188043046809c.js:1:44423) at https://static.twitchcdn.net/assets/worker-cc6cefad358a964412c188043046809c.js:1:46679

discord voice chat was also stuck in 'connecting' state, so I guess websockets no longer work.

Source: hollunder at https://aur.archlinux.org/packages/inox-bin

I can confirm the issue when trying to use Discord at https://discordapp.com.

Discord connects fine if Inox is built with all patches except 0001-fix-building-without-safebrowsing.patch. but I don't know any details yet.

perfect7gentleman commented 6 years ago

confirm

Eloston commented 6 years ago

This is a wild guess as I'm not able to inspect or test right now, but this change https://github.com/gcarq/inox-patchset/commit/da32cbbcd1f10ef34ecd41480a3b34e33160eabc#diff-06bb0d2b5cbd0f1dfbcaabf963cfa895R1363 doesn't feel right to me. I think io_thread->DisableQuic() might be something important.

Instead of deleting the entire DisableQuicOnIOThread, perhaps the safe_browsing_service argument can be removed, as well as all calls to safe_browsing_service?

xsmile commented 6 years ago

@Eloston Thanks for the hint. I tried keeping DisableQuicOnIOThread but it didn't help. The method was missing in previous versions too, see https://github.com/gcarq/inox-patchset/commit/da32cbbcd1f10ef34ecd41480a3b34e33160eabc#diff-06bb0d2b5cbd0f1dfbcaabf963cfa895L1082. It was relocated in 62.

I went trough the patch and tried to make some parts less invasive but didn't have any success.

I noticed that a browser restart results in Discord loading successfully. It fails on subsequent page reloads though.

Eloston commented 6 years ago

@xsmile

I noticed that a browser restart results in Discord loading successfully. It fails on subsequent page reloads though.

With the safe browsing patch unapplied, does it fail on subsequent reloads too?

Another thing that touches WebRTC is the VA-API patch. I don't know of any other patch that would remotely come close.

xsmile commented 6 years ago

@Eloston If only the safe browsing patch is not applied but the rest is applied then the subsequent reloads do work.

I tried disabling VA-API at chrome://flags, it has no influence.

Eloston commented 6 years ago

@xsmile So do these tests fail for you?:

https://www.websocket.org/echo.html http://websocketstest.com/

Eloston commented 6 years ago

Earlier I was confused with WebRTC, so we should make certain which one is actually broken. I thought Discord uses WebRTC for voice, but they could be using both technologies for a variety of things. WebRTC testing sites:

https://test.webrtc.org/ https://webrtc.github.io/samples/

xsmile commented 6 years ago

WebSocket support is detected in all cases.

with safebrowsing patch

on browser restart https://www.websocket.org/echo.html - connect, send, receive work http://websocketstest.com/ - port 80, 443 work; 8080, 443 SSL don't work

on page reload https://www.websocket.org/echo.html - connect, send, receive don't work http://websocketstest.com/ - port 80, 443, 8080, 443 SSL don't work

without safebrowsing patch

all tests pass

I can't comment on WebRTC since I didn't (actively) use it yet and denied most permissions for audio/video access. WebRTC tests at https://test.webrtc.org/ fail with and without the patch, I guess that's fine.

Hoshpak commented 6 years ago

This is what I get in the console when trying to join a discord voice chat:

0b9f04505572f4fcf028.js:79 [RTCConnection(368662581868756994)] Connecting to RTC server wss://eu-central129.discord.gg/.
0b9f04505572f4fcf028.js:79 [RTCControlSocket] [WS CLOSED] (false, 0, The connection timed out after 20000 ms - did not receive OP_HELLO in time.) retrying in 1.99 seconds.
e.(anonymous function) @ 0b9f04505572f4fcf028.js:79
e.log @ 585f67207dbce403ecec.js:1
e.warn @ 585f67207dbce403ecec.js:1
t._handleClose @ 585f67207dbce403ecec.js:1
(anonymous) @ 585f67207dbce403ecec.js:1
r @ 0b9f04505572f4fcf028.js:79
09:36:56.900 0b9f04505572f4fcf028.js:79 [RTCControlSocket] [RECONNECT] wasClean=false code=0 reason=The connection timed out after 20000 ms - did not receive OP_HELLO in time.
xsmile commented 6 years ago

Closing, as this should be fixed in the next release.