Changes to websocket_bridge+trace_processor_shell to support using non-default WebUI origin#4776
Open
helo-xperi wants to merge 2 commits intogoogle:mainfrom
Open
Changes to websocket_bridge+trace_processor_shell to support using non-default WebUI origin#4776helo-xperi wants to merge 2 commits intogoogle:mainfrom
helo-xperi wants to merge 2 commits intogoogle:mainfrom
Conversation
This patch adds the command line argument --http-additional-cors-origins
command line argument to websocket_bridge. It can be used to specify
additional allowed origins at runtime.
Usage:
websocket_bridge \
--http-additional-cors-origins="https://ui.domain.com,https://ui.domain2.com"
…_origins GN arg This patch adds a GN argument, perfetto_http_additional_cors_origins. This GN arg can be set to a comma-separated list of origins that websocket_bridge and trace_processor will allow connections from. This GN arg can be used to allow a Perfetto WebUI hosted on another origin than https://ui.perfetto.dev or http://localhost:1000 to connect to websocket_bridge and trace_processor services by default, without providing --http-additional-cors-origins command line flags. Resolves google#4547
| declare_args() { | ||
| # Comma-separated list of additional CORS origins to allow in trace_processor | ||
| # and websocket_bridge. | ||
| perfetto_http_additional_cors_origins = "" |
Member
There was a problem hiding this comment.
This needs to be in https://source.chromium.org/chromium/chromium/src/+/main:third_party/perfetto/gn/BUILD.gn as part of gen_buildflags not adhoc like this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This set of patches implements changes suggested in #4547 to better support using websocket_bridge and trace_processor with non-default origins, that is origins that are neither of https://ui.perfetto.dev/ or http://localhost:1000/.
It does so by making websocket_bridge support --http-additional-cors-origins argument from trace_processor_shell and also adds a GN arg perfetto_http_additional_cors_origins that can be used to compile both binaries with a by-default supported origin already included.