Skip to content

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
helo-xperi:dev/helo-xperi/4547
Open

Changes to websocket_bridge+trace_processor_shell to support using non-default WebUI origin#4776
helo-xperi wants to merge 2 commits intogoogle:mainfrom
helo-xperi:dev/helo-xperi/4547

Conversation

@helo-xperi
Copy link

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.

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
@helo-xperi helo-xperi requested a review from a team as a code owner February 12, 2026 06:49
declare_args() {
# Comma-separated list of additional CORS origins to allow in trace_processor
# and websocket_bridge.
perfetto_http_additional_cors_origins = ""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants