A socket.io server implementation in Rust that integrates with the Tower ecosystem and the Tokio stack.
MIT License
Bot releases are hidden (Show)
MSRV: Minimum supported Rust version is now 1.75.
SocketRef
extractor is now Clone
. Be careful to drop clones when the socket is disconnected to avoid any memory leak.Full Changelog: https://github.com/Totodore/socketioxide/compare/v0.11.1...v0.12.0
Published by Totodore 7 months ago
Full Changelog: https://github.com/Totodore/socketioxide/compare/v0.11.0...v0.11.1
Published by Totodore 8 months ago
Operators
and BroadcastOperators
in order to split logic and fn signatures between broadcast and non-broadcast operators.0x4
was not added to the binary payload with ws
transport.base64
to 0.22.0.heaptrack
job by @Totodore in https://github.com/Totodore/socketioxide/pull/265
Full Changelog: https://github.com/Totodore/socketioxide/compare/v0.10.2...v0.11.0
Published by Totodore 9 months ago
rooms
fn to get all the rooms of a namespace.io
by @Totodore in https://github.com/Totodore/socketioxide/pull/248
Full Changelog: https://github.com/Totodore/socketioxide/compare/v0.10.1...v0.10.2
Published by Totodore 9 months ago
as_str
fn for Sid
.as_str
fn for Sid
by @Totodore in https://github.com/Totodore/socketioxide/pull/224
Full Changelog: https://github.com/Totodore/socketioxide/compare/v0.10.0...v0.10.1
Published by Totodore 10 months ago
emit_with_ack
fns. It now returns an AckStream
that can be used either as a future when expecting one ack or as a stream when expecting multiple acks. When expecting multiple acks the AckStream
will yield AckResult
s as well as their corresponding socket id
.rust_socketio
client by @Totodore in https://github.com/Totodore/socketioxide/pull/219
cors
for salvo_echo
by @Totodore in https://github.com/Totodore/socketioxide/pull/221
Full Changelog: https://github.com/Totodore/socketioxide/compare/v0.9.1...v0.10.0
Published by Totodore 10 months ago
SocketIo::get_socket
and Operators::get_socket
methods to get a socket ref from its id.pin-project-lite
instead of pin-project
.pin-project-lite
for Pin Projection by @Totodore in https://github.com/Totodore/socketioxide/pull/200
Full Changelog: https://github.com/Totodore/socketioxide/compare/v0.9.0...v0.9.1
Published by Totodore 10 months ago
hyper
to 1.0.1. It is now possible to use frameworks based on hyper v1.*. Check the compatibility table for more details.http
to 1.0http-body
to 1.0tokio-tungstenite
to 0.21.0Published by Totodore 10 months ago
transport_type
and protocol
fn on the Socket
struct. It allows to know the transport type and the protocol used by the socket.DisconnectHandler
. Now the on_disconnect
handler take a dynamic handler that maybe async and contain any type that implements FromDisconnectParts
. It allows to extract data from the disconnection, like the socket, the reason of the disconnection, the state etc.state
feature flag. It enables global state management. It is useful to share data between handlers. It is disabled by default.engineio
packets processing by @Totodore in https://github.com/Totodore/socketioxide/pull/162
Socket
by @Totodore in https://github.com/Totodore/socketioxide/pull/180
tower
links by @Totodore in https://github.com/Totodore/socketioxide/pull/181
state::TypeMap
by @Totodore in https://github.com/Totodore/socketioxide/pull/194
Full Changelog: https://github.com/Totodore/socketioxide/compare/v0.7.3...v0.8.0
Published by Totodore 11 months ago
tokio::spawn
.Full Changelog: https://github.com/Totodore/socketioxide/compare/v0.7.2...v0.7.3
Published by Totodore 11 months ago
on_disconnect
callback now takes a SocketRef
rather than an Arc<Socket>
to match other handlers. It also avoids that the user clone the socket and create a memory leak.async_trait
deps by @Totodore in https://github.com/Totodore/socketioxide/pull/159
on_disconnect
callback take a SocketRef
by @Totodore in https://github.com/Totodore/socketioxide/pull/171
Full Changelog: https://github.com/Totodore/socketioxide/compare/v0.7.1...v0.7.2
Published by Totodore 11 months ago
hyper-v1
feature flag because of hyper-util
dependency which is not published on crates.io.tokio_io
module for hyper v1
by @Totodore in https://github.com/Totodore/socketioxide/pull/155
Full Changelog: https://github.com/Totodore/socketioxide/compare/v0.7.0...v0.7.1
Published by Totodore 11 months ago
extensions
field on sockets has been moved to a separate optional feature flag named extensions
tracing
internal calls have been moved to a separate optional feature flag named tracing
hyper-v1
. You can call with_hyper_v1
on the SocketIoLayer
or the SocketIoService
to get a layer/service working with hyper v1. Therefore, it is now possible to use salvo
as an http server. The default is still hyper v0.--no-default-features
will always work without enabling anything else.FromMessageParts
or FromMessage
as a parameter for a message handler and FromConnectPart
for a connect handler. This is useful to extract data from the event, like the socket, the data, an acknowledgment, etc.Socket::req_parts()
.tracing
internal calls have been moved to a separate optional feature flag named tracing
hyper-v1
. You can call with_hyper_v1
on the EngineIoLayer
or the EngineIoService
to get a layer/service working with hyper v1. The default is still hyper v0.--no-default-features
will always work without enabling anything else.on_connect
handler was called twice when upgrading to websocket. It is now called only once.Cow<'static, str>
by @Totodore in https://github.com/Totodore/socketioxide/pull/124
LocalAdapter
as generic param by @Totodore in https://github.com/Totodore/socketioxide/pull/139
ced9f81
to 11776bd
by @dependabot in https://github.com/Totodore/socketioxide/pull/144
io
operator by @Totodore in https://github.com/Totodore/socketioxide/pull/150
Full Changelog: https://github.com/Totodore/socketioxide/compare/v0.6.0...v0.7.0
Published by Totodore 12 months ago
Thanks to @sleeyax for the support of the socket.io v4 protocol.
Thanks to @tausifcreates for minor fixes.
SocketIo
struct is now returned with the layer/service and allows to access namespaces/rooms/sockets everywhere in the application. Moreover, it is now possible to add and remove namespaces dynamically through the SocketIo
struct.v4
protocol is now available under the feature flag v4
, it matches every socket.io js version from 1.0.3 to current . The v5
protocol is still the default and is more performant, it matches every socket.io js version from v3.0.0 to current.Arc<Socket>
.max_payload
option is now applied when encoding a packet. Before, it was only applied when decoding a packet.websocket
transport, packets are now bufferred before being flushed. Before, they were flushed one by one.tx_map_fn
& close_fn
declaration to Engine impl by @tausifcreates in https://github.com/Totodore/socketioxide/pull/98
Full Changelog: https://github.com/Totodore/socketioxide/compare/v0.5.1...v0.6.0
Published by Totodore about 1 year ago
Full Changelog: https://github.com/Totodore/socketioxide/compare/v0.5.0...v0.5.1
Published by Totodore about 1 year ago
on_disconnect
function is now available on the Socket
instance. The provided callback will be called when the socket disconnects with the reasons for the disconnection. This is useful for logging or cleanup data.connect_timeout
option is now available in the config options. It is the maximum time to wait for a socket.io handshake before closing the connection. The default is 45 seconds.NsHandlers
struct was added. It describes namespace handlers passed to the SocketIoLayer/SocketIoService. Before, it was a type alias for a HashMap and it was containing types that were not supposed to be public.DisconnectReason
enum is passed to the on_disconnect
callback of the engine handler.tokio-tungstenite
to 0.20.1.Full Changelog: https://github.com/Totodore/socketioxide/compare/v0.4.1...v0.5.0
Published by Totodore about 1 year ago
Engine
by @Totodore in https://github.com/Totodore/socketioxide/pull/32
Full Changelog: https://github.com/Totodore/socketioxide/compare/v0.3.0...v0.4.1
Published by Totodore over 1 year ago
Full Changelog: https://github.com/Totodore/socketioxide/compare/v0.2.0...v0.3.0