feature(sockets): Add the option to use unix sockets instead of a hostname / port combination#399
Open
WickedSik wants to merge 2 commits intokiwiirc:masterfrom
Open
feature(sockets): Add the option to use unix sockets instead of a hostname / port combination#399WickedSik wants to merge 2 commits intokiwiirc:masterfrom
WickedSik wants to merge 2 commits intokiwiirc:masterfrom
Conversation
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.
Add Unix domain socket support to the Node.js transport layer.
This allows connecting to IRC servers (or bouncers like ZNC) via Unix sockets instead of TCP host/port, which is useful when the IRC daemon runs on the same machine. Connections can be plain or TLS-wrapped.
What changed:
src/transports/net.js— Extended the connection logic to accept apathoption for Unix domain sockets. Whenpathis provided, it takes priority overhost/port. Supports both plain (net.connect) and TLS (tls.connect) modes, including client certificates andrejectUnauthorized.test/net.transport.test.js— Added a comprehensive test suite for the net transport. Covers plain TCP, TLS, Unix socket, and TLS-over-Unix-socket connection modes. Also covers socket lifecycle methods (close,disposeSocket,writeLine,onSocketData, etc.) and address family detection — none of which had dedicated tests before.README.md/docs/clientapi.md— Updated documentation with Unix socket usage examples and the newpathconnect option.Usage:
When
pathis set,hostandportare ignored. No breaking changes to existing connection behavior.