net: support AF_UNIX paths in net.BoundSocket#64399
Open
guybedford wants to merge 5 commits into
Open
Conversation
Collaborator
|
Review requested:
|
guybedford
force-pushed
the
net-boundsocket-pipe
branch
from
July 10, 2026 00:24
1e91371 to
6a4fee8
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #64399 +/- ##
==========================================
+ Coverage 90.14% 90.15% +0.01%
==========================================
Files 741 741
Lines 242076 242164 +88
Branches 45558 45568 +10
==========================================
+ Hits 218216 218327 +111
+ Misses 15385 15358 -27
- Partials 8475 8479 +4
🚀 New features to boost your workflow:
|
Ethan-Arrowood
approved these changes
Jul 10, 2026
Ethan-Arrowood
left a comment
Contributor
There was a problem hiding this comment.
LGTM with just some doc changes and one question about the implementation.
guybedford
force-pushed
the
net-boundsocket-pipe
branch
3 times, most recently
from
July 16, 2026 01:18
9571737 to
3429149
Compare
jasnell
reviewed
Jul 16, 2026
jasnell
reviewed
Jul 16, 2026
jasnell
approved these changes
Jul 16, 2026
jasnell
left a comment
Member
There was a problem hiding this comment.
Couple of nits but otherwise LGTM
guybedford
force-pushed
the
net-boundsocket-pipe
branch
from
July 20, 2026 22:45
542c603 to
6472cd1
Compare
Collaborator
Signed-off-by: Guy Bedford <guybedford@gmail.com>
Only trust the adopted handle's type when it came from a BoundSocket; a TLSSocket's _handle is a TLSWrap, not a Pipe, so TLS/HTTPS over pipes must still infer pipe-ness from the path option.
guybedford
force-pushed
the
net-boundsocket-pipe
branch
from
July 21, 2026 18:12
6472cd1 to
f30b9ca
Compare
Collaborator
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.
Extends
net.BoundSocket(#63951) with apathoption so it can immediately bind a named unix-domain socket (or Windows pipe) synchronously, not just TCP. This gives a public synchronous UDS bind through the same role-neutral handle, instead of reaching intoprocess.binding('pipe_wrap'), just as it replaces the need fortcp_wrapandudp_wrapsimilarly.pathis mutually exclusive withhost/port/ipv6Only/reusePort, and binds in the constructor so conflicts throw there like TCP does. A leading'\0'uses the Linux abstract namespace; an abstract path elsewhere throwsERR_INVALID_ARG_VALUE.address()returns the path string for a pipe (asServer.address()does), the address object for TCP.isPipegetter to tell the two apart.server.listen(bound)andnew net.Socket({ handle: bound }).connect()pick pipe vs TCP from the adopted handle's type.localAddress.Note two error codes match libuv rather than intuition: missing parent dir is
EACCES(libuv mapsENOENT), over-long path isEINVAL(UV_PIPE_NO_TRUNCATE).Tests cover sync bind +
address(), duplicate-bindEADDRINUSE, the listen/connect round-trip, bound-clientlocalAddress, the abstract namespace, and the error paths.