Repository navigation
Conversation
Networks with no WebSocket listener can be reached from the Tauri apps
over plain TCP or TLS. The page keeps WsTransport and its whole
connection policy; underneath it, ShellSocket stands in for the
WebSocket and moves lines through a new Socket plugin in the shell
(src/socket.rs), which does the framing, TLS (rustls on ring, Mozilla's
roots) and the limits a page-reachable raw socket needs.
- transport.ts: WebSocketImpl takes a LineSocket, the part of WebSocket
WsTransport uses.
- shellSocket.ts: ordered shell calls per socket, its own close event,
error-then-close on failure.
- ConnectOptions.transport ("tcp"), carried through saved networks,
applySettings and endpointChanged; TCP default ports 6667/6697.
- STS policies keyed per transport (tcp:host), so a WebSocket port is
never used for TCP or the reverse.
- TCP-specific close hints; a Connection select in both network forms,
shown only inside the app.
- A browser refuses a TCP network instead of retrying it.
No certificate pinning yet: a self-signed server is reachable over
plain TCP only.
Shell socket (src/socket.rs): - Keep it an IRC client: no empty lines, and only registration commands until the server's first line looks like IRC; a first line that does not (an HTTP status, a Redis -ERR, an SMTP greeting) closes the socket. - A write that takes over 10 s closes the socket; after the page closes one, the queued lines, the flush and the shutdown share the 2 s drain. - Sends are refused until the socket is open. - Every open carries the page load's token; an open from the page before a reload, handled after it, is refused instead of leaving an orphan. - A page load keeps the old sockets for 1 s so the QUIT its pagehide sends still goes out (WebKit starts the new load before pagehide). - An untrusted certificate is reported in words; the TLS config is built once. Page: - The connect form can switch a saved TCP network back to WebSocket (saved-networks.ts mergeOptions), and findMatching keys on transport. - ShellSocket: a bridge that throws at once fails like a refusal, and a listener's throw no longer costs the rest of a read's lines. - Feature notes in docs/resources/client-features.md.
…y call seance_call alone
- The first-line gate wants a prefix or tags, or PING/NOTICE/ERROR with a parameter: memcached answers anything with a bare ERROR. - At most 30 opens a minute, so the page cannot scan a LAN through the shell. - A certificate not valid yet (a wrong device clock) is retried, not final. - The forms send transport "websocket" to switch back; options without a transport keep the stored one, and comparisons treat websocket as absent. - One end_socket for both ways a socket ends; helpers private; no separate tokio dev-dependency.
This branch was previously deployed
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.
What
The app (Tauri shell) can now connect to IRC networks over plain TCP or TLS, not just WebSocket, so users can join networks that have no WebSocket listener. In the connect form and the network editor, a new Connection choice (WebSocket / TCP) appears only inside the app. In a browser or the PWA nothing changes. Browsers have no raw-socket API outside managed ChromeOS, so they would need a gateway, which is out of scope here.
How
client/js/irc/shellSocket.ts:ShellSocketdresses a shell-made TCP socket as the part of a WebSocket thatWsTransportuses (the newLineSocketinterface). Retries, the probe, PING, the line cap and registration are shared unchanged.shells/tauri/src-tauri/src/socket.rs: aSocketplugin built on tokio and rustls (ring, Mozilla roots). It splits and decodes lines (UTF-8, Latin-1 fallback) and emits them in batches.transport: "tcp". STS policies are keyedtcp:hostso a WebSocket policy never rewrites a TCP dial. Default ports are 6667/6697. The disconnect hints have TCP-specific wording.Limits on the raw socket
The page can be made to dial anything, so the shell restricts what it will do:
pagehideQUIT still goes out.A failure a retry can't mend (an untrusted certificate, a server that isn't IRC) closes with code 4001, and the page shows the reason once instead of retrying.
build.rsrestricts the app's commands toseance_call, whichcapabilities/default.jsongrants to the main window only.Testing
pnpm lint,pnpm typecheck,pnpm i18n:checkand mocha all pass (newtest/irc/shellSocket.ts, plus TCP cases in the client, saved-networks, STS and disconnect tests).cargo testpasses (12 tests) and clippy is clean.ws://and dropstransportfrom the saved entry.Known limits