brave-browser icon indicating copy to clipboard operation
brave-browser copied to clipboard

Single websocket won't connect using brave. Works for all other browsers.

Open Rambatino opened this issue 3 years ago • 15 comments

Similar issue here: https://github.com/brave/brave-browser/issues/22851

But apparently fixed.

Description

After multiple refreshes of our app: https://endx.gg, the websockets stop connecting.

Chrome works as expected, as does wscat.

E.g. wscat -c "wss://auth.endx.gg/api/prices"

Steps to Reproduce

  1. Head to endx.gg
  2. Sign in with [email protected]
  3. Password: Testing1!
  4. Shields can be up or down
  5. Refresh the browser multiple times (keep refreshing until it happens)
  6. Websockets stop connecting

Actual result:

image

Expected result:

On chrome:

image

Reproduces how often:

All the time.

Brave version (brave://version info)

Version 1.40.107 Chromium: 103.0.5060.53 (Official Build) (arm64)



Brave | 1.40.107 Chromium: 103.0.5060.53 (Official Build) (arm64)
-- | --
Revision | a1711811edd74ff1cf2150f36ffa3b0dae40b17f-refs/branch-heads/5060@{#853}
OS | macOS Version 12.4 (Build 21F79)
JavaScript | V8 10.3.174.14
User agent | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.53 Safari/537.36
Command Line | /Applications/Brave Browser.app/Contents/MacOS/Brave Browser --disable-client-side-phishing-detection --disable-domain-reliability --enable-dom-distiller --no-pings --component-updater=url-source=https://go-updater.brave.com/extensions --origin-trial-public-key=bYUKPJoPnCxeNvu72j4EmPuK7tr1PAC7SHh8ld9Mw3E=,fMS4mpO6buLQ/QMd+zJmxzty/VQ6B1EUZqoCU04zoRU= --sync-url=https://sync-v2.brave.com/v2 --lso-url=https://no-thanks.invalid --variations-server-url=https://variations.brave.com/seed --variations-insecure-server-url=https://variations.brave.com/seed --flag-switches-begin --flag-switches-end
Executable Path | /Applications/Brave Browser.app/Contents/MacOS/Brave Browser
Profile Path | /Users/mark/Library/Application Support/BraveSoftware/Brave-Browser/Profile 1
Linker | lld
Active variations | AdRewardsStudy:NextPaymentDayAdServingStudy:DefaultAdNotificationsPerHour=10/MaximumAdNotificationsPerDay=100/MaximumInlineContentAdsPerHour=12/MaximumInlineContentAdsPerDay=60BraveAds.EpsilonGreedyBanditStudy:ControlBraveAds.FrequencyCappingStudy:ExcludeAdIfWithinTimeWindow=0hBraveAds.UserActivityStudy:Triggers=EMPTY/Threshold=0.0/IdleTimeThreshold=5BraveDebounceStudy:EnabledConversionsStudy:NewDefaultPatternDefault1pBlockingStudy:DisabledDisableReduceLanguage:DefaultEphemeralStorageStudy:EnabledExtendedVariationsSafeMode5:SignalAndWriteViaFileUtil5FirstPartyEphemeralDomainBlockStudy:EnabledForceDisableBlinkFeatures:EnabledMacCoreLocationBackendStudy:EnabledNativeCosmeticFilteringStudy:EnabledPartitionBlinkMemoryCacheStudy:EnabledPartitionConnectionsByNetworkIsolationKeyStudy:EnabledPermissionLifetimeReleaseStudy:EnabledRequestAdsEnabledApiStudy:EnabledSpeedreaderReleaseStudy:Enabled

Version/Channel Information:

  • Can you reproduce this issue with the current release? yes
  • Can you reproduce this issue with the beta channel? not tried
  • Can you reproduce this issue with the nightly channel? not tried

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields? no
  • Does the issue resolve itself when disabling Brave Rewards? no
  • Is the issue reproducible on the latest version of Chrome? no

Miscellaneous Information:

Rambatino avatar Jun 29 '22 12:06 Rambatino

cc: @ryanbr

rebron avatar Jul 07 '22 21:07 rebron

Testing in Brave 1.41.96.

I refreshed the page a few times (10 so far), takes a few seconds between a refresh and the page loading. Nothing so far @Rambatino Can you re-test in the latest ver?

ryanbr avatar Jul 14 '22 05:07 ryanbr

Hi @ryanbr thanks for getting back to me. Just tried it on the new version and it's still an issue.

I've been using cmd+shift+r and if it still works, then I press it multiple times in a row before the page has reloaded and then the socket stops connecting.

Would you mind having another go please? 🙏

(you will need to be logged in to access the websocket)

Rambatino avatar Jul 14 '22 11:07 Rambatino

For context, this is the issue:

image

Rambatino avatar Jul 19 '22 15:07 Rambatino

I have the same issue. I am working on the backend based on Nest.js. I have WebSocket that all other browsers will work fine but the brave browser was working fine after a while it won't receive messages from a WebSocket. note that my operating system is Windows 10 in case you want to change the issue tag.

mmRoshani avatar Jul 27 '22 06:07 mmRoshani

same here and tested on Linux. [Version 1.42.86 Chromium: 104.0.5112.81 (Official Build) (64-bit)]

moraisaugusto avatar Aug 11 '22 14:08 moraisaugusto

Problems with websockets too. Can't connect.. but it works with chrome and firefox. Linux OS

[Version 1.42.97 Chromium: 104.0.5112.102 (Official Build) (64-bit]

vicenterusso avatar Jan 30 '23 12:01 vicenterusso

Same here.

Need to disable Trackers & ads blocking: image

I am a little bit disappointed

(EDIT: I calibrated my language to not appear pretentious)

There should be some flag "allow dev mode" to connect to localhost.

(apparently someone in the past abused it to fingerprint / track users)

I've heard about Brave since 2017 and BAT, and here we are in 2023, in the meanwhile tried many times to switch and each time I found some "non starter" issue in the first 5-10 minutes of usage.

Related: https://github.com/danhper/atomic-chrome/issues/36

marsrobertson avatar Mar 22 '23 11:03 marsrobertson

I also have this issue. On brave version: 1.49.128 Chromium: 111.0.5563.110 (Official Build)

kokofixcomputers avatar Apr 23 '23 21:04 kokofixcomputers

I'm unable to repro the issue on https://csgo.endx.gg/dashboard after logging in using the test creds provided. I hard refreshed several times, and didn't get the broken page. Is this still an issue?

ShivanKaul avatar May 04 '23 19:05 ShivanKaul

@ShivanKaul we switched to ably to manage our sockets instead which is a single socket.

Rambatino avatar May 05 '23 08:05 Rambatino

I have the same issue.

I have an external app that hosts ws endpoints, and when I try to connect, I get: "webSocket connection to 'wss://{url}' failed:"

After disabling the option for "disable Trackers & ads blocking", everything works.

jzatarain avatar May 18 '23 22:05 jzatarain

Can you say which external app it is?

ShivanKaul avatar May 18 '23 22:05 ShivanKaul

Unfortunately, It's not a public app, but I can tell you that it is an app written in asp .net 6 that just maps a middleware for websockets.

jzatarain avatar May 18 '23 22:05 jzatarain

I also have an issue with WebSockets being blocked during the handshake. I can see the connection hitting my server but it doesn't complete it, it stays stuck in pending status for a while and then I eventually get:

WebSocket connection to 'wss://example.com/socket/' failed: WebSocket is closed before the connection is established.

I'm using nginx to proxy websockets on the back end though I doubt that's the problem. I tried restarting it and also my WebSocket server and the issue persisted. It works fine in all other browsers. I opened a new incognito tab with Brave and it also worked... Then I go back to a regular Brave tab and it doesn't work. I tried disabling the shields, this seems to have fixed it in the past, but not anymore.

One weird thing I noticed is that, when I look at the WebSocket messages, under the Timing tab, it says Stalled 7.6 days... I only just opened the connection so I don't see how it could have taken 7.6 days... Could it be some issue with old sockets from several days ago which did not get cleaned up? The issue persists even when I open new (non-icognito) tabs within the same Browser window.

I'm using Linux (Kubuntu). I noticed that if I close the browser, open it again and try again, it starts working again! Will be fine for several days or weeks. This seems to support the theory of it being related to old socket data not getting cleaned up properly.

jondubois avatar Feb 18 '24 03:02 jondubois