Allow WebSocket requests over the network - #538
Conversation
While media access permissions are relegated to legacy behaviour by default, most remaining permissions are denied implicitly. WebSocket requests seem to be treated differently yet, where an additional case is handled for a website attempting to access local devices. This recreates behaviour from previous CEF versions in modern releases. Reference https://github.com/chromium/chromium/blob/8408977/services/network/public/cpp/features.cc#L273-L279
Warchamp7
left a comment
There was a problem hiding this comment.
Have not explicitly tested the change, but the behaviour is desired for now per the PR description.
|
Follow-up on this PR: it exempts WebSockets, but the other request types from remote HTTPS browser sources to local services will still be blocked on CEF 150.
This affects remotely hosted overlays that read a local app's HTTP/SSE API on Reproduced on Chromium 149, which uses the same network-service path. The page is made public via
I have not reproduced it in an OBS Git build. The analysis is based on master (a162443) plus the WebSocket failure you already hit here. Since no permission callback was reached for WebSockets either, a permission handler alone may not cover it. Could the "retain pre-Chrome-runtime behaviour" intent be extended to these requests before 33.0? That would mean either disabling |
Description
Well this solution ended up being different than I expected.
I had previously prepared WizardCM@4c65eaa which would show a permission request dialog.
However, in my testing today, this dialog does not get triggered for a website attempting to access the local network for WebSockets, at least on CEF 150. Neither
OnRequestMediaAccessPermissionnorOnShowPermissionPromptget called.This is strange, because on a shipping version of Google Chrome, a permission dialog is displayed, and clicking Allow enables the connection. Further digging is required but is not a blocker for this PR.
The flow in CEF works like so
OnRequestMediaAccessPermissionOnShowPermissionPromptWebcam and Microphone seem to continue to work via
--enable-media-streamper this documentation, which I have verified is true. This behaviour is unchanged before or after this PR.Motivation and Context
Retain pre-Chrome-runtime behaviour for all permissions (for now). In this case, the ability for a browser source or dock's webpage to make outgoing WebSocket requests.
Fixes
ERR_BLOCKED_BY_LOCAL_NETWORK_ACCESS_CHECKSWe do not want to provide regressions while a better solution is devised.
At the same time, we also don't want to open too many security holes by using broad toggles.
How Has This Been Tested?
Launch with CEF 150 on Windows pointed to
https://obs.wesbos.com/Attempt to log in.
Types of changes
Checklist: