Repository navigation
feat(server): optional Unix-domain socket for CDP - #4023
Merged
Merged
Conversation
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
Allow WebDriver protocol (yes, we might advertise an invalid session URL, but I think if someone uses --unix-socket, they'll be able to deal with that (at least we can give them the chance to)) Dedupe json/version payload generation Centralize all flag validation in Config.zig
Collaborator
|
Thanks. I renamed the option to --unix-socket and did some other fairly superficial changes. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Add an opt-in
lightpanda serve --socket /absolute/path/lightpanda.socktransport for CDP HTTP/WebSocket instead of opening a TCP listener. This is the small, native first step discussed by the maintainer in #3452; it intentionally does not add a bearer-token scheme or claim to protect against processes sharing the same Unix identity.The existing TCP mode remains the default.
Behavior
--socketis mutually exclusive with--host,--port, and--advertise-host; Unix mode is CDP-only rather than advertising an invalid WebDriver BiDi session URL.0600, refuses to overwrite an existing path, and unlinks its socket on normal shutdown.GET /json/versionreturnswebSocketDebuggerUrl: nullrather than a fictitious TCP URL. Unix-aware clients connect to the socket directly.Verification (Linux x86_64, Zig 0.17.0, upstream main
2ad3877)make download-v8: prebuilt V8 installed.zig build -Ddev_fast=true: PASS.make test: 1,877/1,877 passing, 7 skipped by upstream runner.zig fmt --check ./*.zig ./**/*.zig: PASS.0600, no TCP listener opened by this server/json/version200, null WebSocket discovery URLBrowser.getVersionprotocol 1.3--portrejected, socket removed on SIGTERMSecurity scope
Unix socket permissions do not isolate processes sharing a Unix identity, or those with ptrace/Docker/administrator authority. Per-peer
SO_PEERCRED, PID or pidfd authorization are not in scope; those are separate design decisions. This references #3452 but does not close the broader authentication question.Thanks for the guidance on #3452. Happy to adjust the interface or tests to fit project conventions.