Skip to content

feat(compute/serve): allow local WebSocket passthrough to be disabled - #1876

Open
harmony7 wants to merge 2 commits into
mainfrom
kats/fanout-websockets-handle-unsupported
Open

feat(compute/serve): allow local WebSocket passthrough to be disabled#1876
harmony7 wants to merge 2 commits into
mainfrom
kats/fanout-websockets-handle-unsupported

Conversation

@harmony7

@harmony7 harmony7 commented Aug 7, 2026

Copy link
Copy Markdown
Member

Change summary

Adds a way to disable Viceroy's local WebSocket passthrough from fastly compute serve, for cases where it isn't supported or isn't wanted.

There are two controls, both defaulting to enabled:

  • a new [local_server.websockets_passthrough] section in fastly.toml with an enable key, mirroring the existing [local_server.pushpin] section
  • a new --experimental-websockets-passthrough flag on compute serve, which takes precedence over the manifest (so --no-experimental-websockets-passthrough disables it, and the flag can also re-enable it over a manifest enable = false)

Viceroy already enables WebSocket passthrough by default and that isn't expected to change, so we only pass --enable-local-websocket-passthrough=false when the effective value is false, and pass nothing at all otherwise. That keeps the invocation unchanged for everyone who doesn't opt out.

Resolution order in serve.go:

  1. --experimental-websockets-passthrough, if set
  2. local_server.websockets_passthrough.enable, if set
  3. true

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  • Does your submission pass tests?

Changes to Core Features:

  • Have you written new tests for your core changes, as applicable?
  • Have you successfully run tests with your changes locally?

[local_server.websockets_passthrough] was added to pkg/manifest/testdata/fastly-viceroy-update.toml so the existing TestManifestPersistsLocalServerSection round-trip test covers the new section, and the new flag was added to the ignore list in the compute build / compute serve flag-parity test. go build ./..., gofmt, go vet, and the pkg/app, pkg/manifest, and pkg/commands/compute test packages all pass locally.

User Impact

No change unless a user opts in: with neither the flag nor the manifest section set, the Viceroy command line is byte-for-byte what it was before. Users who need to turn passthrough off now have a supported way to do it.

Are there any considerations that need to be addressed for release?

No breaking changes.

This feature requires fastly/Viceroy#678 to be shipped first. Also worth noting that --enable-local-websocket-passthrough is only ever passed when a user explicitly disables passthrough, so existing setups can't hit that.

Adds a way to turn off Viceroy's local WebSocket passthrough, for cases
where it is not supported or not wanted.

Two controls, both defaulting to enabled:

- a new `[local_server.websockets_passthrough]` section in fastly.toml,
  with an `enable` key
- a new `--experimental-websockets-passthrough` flag on `compute serve`,
  which takes precedence over the manifest

Viceroy already enables WebSocket passthrough by default, so we only pass
`--enable-local-websocket-passthrough=false` when the effective value is
false, and pass nothing otherwise.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@harmony7
harmony7 marked this pull request as ready for review August 8, 2026 07:47
@harmony7
harmony7 requested a review from a team as a code owner August 8, 2026 07:47
@harmony7
harmony7 requested a review from jedisct1 August 8, 2026 07:47
@harmony7 harmony7 added the blocked A fix is dependant on a separate change/feature. label Aug 8, 2026
@harmony7

harmony7 commented Aug 8, 2026

Copy link
Copy Markdown
Member Author

This feature requires fastly/Viceroy#678 to be shipped first.

@harmony7 harmony7 added DO NOT MERGE YET and removed blocked A fix is dependant on a separate change/feature. labels Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants