Repository navigation
Conversation
The app shell can dial IRC over plain TCP or TLS (shells/tauri/src-tauri/src/socket.rs, tokio + rustls on ring with Mozilla roots), dressed as a WebSocket for WsTransport (client/js/irc/shellSocket.ts). A Connection select in the connect form and the network editor, shown only in the app. The shell gates what the page can do with a raw socket: bad ports, line checks, registration-only until the server speaks IRC, queue/timeout/socket/open-rate caps, a page token per load. Untrusted certificates are final, not retried; seance_call is the only app command and only the main window may call it.
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:
PING/NOTICE/ERRORwith a parameter), which stops HTTP, SMTP and memcached smuggling;pagehideQUIT still goes out.A failure a retry can't mend (an untrusted certificate, a server that isn't IRC; a certificate not valid yet is retried, since the device clock may be wrong) 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 (11 tests) and clippy is clean.ws://and dropstransportfrom the saved entry.Known limits