Tauri plugin
Plugin changelog
All notable changes to tauri-plugin-socketio and tauri-plugin-socketio-api.
All notable changes to tauri-plugin-socketio (crate) and tauri-plugin-socketio-api (npm)
are documented in this file. Both are released together with the same version.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased
0.2.0 - 2026-11-21
Security
- A webview may not set the
Origin,Forwarded,X-Forwarded-*andX-Real-IPheaders (a page could pose as another origin or client address to the server). - A webview's query can no longer override engine.io's own parameters (
sid,EIO,transport,t,b64): with a read-only client's engine sid fromlinkInfo, a page could disturb that client's polling session (socketio-next drops those keys now).
Fixed
- The clients a webview connected are disconnected when its window is destroyed (a reload keeps
them), and one webview may have at most
MAX_CLIENTS_PER_WEBVIEW(64) at once (TooManyClients); before, a loop of connect + close left every client connected. - A
reconnectracing adisconnectrevived a client that was already unregistered; the revived connection is closed again and the id reported unknown.
Fixed (guest-js)
connect()/attach(): the messages that came before the call resolved are held until the subscription's snapshot arrived, not for one fixed tick; a large event ahead of the snapshot (Tauri sends it byfetch) made staleconnecting/connectedstates fire again.- A throwing listener no longer stops the other listeners or the later messages; the error is rethrown on its own.
off(event, fn)removes a listener added withonce(event, fn).Blob/Filearguments are read and sent as binary (they went out as{}).- After
disconnect()the socket reportsclosed(io client disconnect) right away. - A failed ack answer (expired, or answered by another socket of the webview) is logged instead of an unhandled promise rejection.
Added (guest-js)
connect,disconnect(with the reason) andconnect_errorevents from the state transitions, as socket.io-client emits them.
Changed
- Documentation at https://s00d.github.io/rust-socketio/tauri/setup; the README is short and links to it.
- guest-js exports the
WireArgstype (the return type ofencodeArgs). - guest-js needs
@tauri-apps/api2.12.3 or newer (earlier versions stop a channel after a throwing callback and leak channel callbacks). - Connect options in milliseconds (
timeout,reconnectionDelay,reconnectionDelayMax) are read likeemitWithAck's timeout: a fraction is cut (it was refused), a negative is refused.
0.1.0 - 2026-11-08
Added
- First release: a registry of named socketio-next clients shared by Rust and the webviews.
- Rust:
SocketIoExt::socketio()→SocketIowithconnect,insert(Access::Full/Access::ReadOnly),get,access,ids,remove(never disconnects),subscribe/unsubscribe. Ids are unique (AlreadyExists, no silent replacement). - JS:
connect,attach,list;Socketwithemit,emitWithAck,on/once/off/onAny/offAny,onState,state,linkInfo,connected,id,disconnect,close; typedSocketIoError { kind, message, data }. - Per-subscription IPC channels (ordered, per webview) with an optional event filter; ended on unsubscribe, on a failed send, when the webview loads a new page or its window is destroyed, and when the client is removed.
- Server acks answered from JS: one
ackIdper server ack for every subscribed webview, answered once; 2 min TTL and a budget per webview; not offered for read-only clients or once a disconnect started. SocketIo::reserve(id): ids Rust registers later cannot be taken by a page script.Builder::allow_url_prefix: URL allow-list for webview connects (the CSP does not cover these sockets);init()isBuilder::new().build().- Webview isolation:
unsubscribeandackact only on the caller's subscriptions and acks; at most 64 subscriptions per webview. connect/attachresolve with the current state (the socket isconnectedright away); the channel starts with that snapshot (snapshot: true) and nothing older follows it.- One forwarding hub per client: ending a subscription drops its channel; a reload during a
JS
connectleaves no subscription behind. setAuth/setHeaders/setQuery(commandsset_auth,set_headers,set_query) for clients a webview connected, read before every connect attempt;reconnectafterclosed; acaoption (PEM) for private CAs.linkInfohaspacketsIn/packetsOut,bytesIn/bytesOut,sessions;disconnectedstates carry the error (WebsocketClosedwithdata: { code, reason });HttpStatuserrors havedata.message.- The URL allow-list checks the engine.io path the connection uses (not the URL path, which
is the namespace); concurrent connects hold their id and subscription slot, so they cannot
pass the per-webview cap;
reconnectonly for clients a webview connected; headers the webview may not set (Host,Cookie,Sec-WebSocket-*,Proxy-*, ...). - The URL allow-list compares the URL socketio-next really builds (dot segments resolved) and
refuses
..,%2eand backslashes inpath. StateandMessageand their struct-like variants are#[non_exhaustive].- Typed
InvalidOptionsfor wrong option types/values (values are not echoed); connect options'Debughides query, header and auth values. - Binary arguments both ways (
Uint8Array↔ socket.io attachments). - Permissions per command,
socketio:allow-read(observe only) andsocketio:default. - Features
rustls(default) andnative-tls, forwarded to socketio-next.