Skip to content

Fix rumqttc build with websocket feature enabled#999

Merged
giridher-art merged 1 commit intobytebeamio:mainfrom
MightyPork:fix-websocket-build
Nov 17, 2025
Merged

Fix rumqttc build with websocket feature enabled#999
giridher-art merged 1 commit intobytebeamio:mainfrom
MightyPork:fix-websocket-build

Conversation

@MightyPork
Copy link
Contributor

@MightyPork MightyPork commented Oct 17, 2025

This is a fix for building rumqttc with the websocket feature enabled.

Note that the Cargo.lock in the workspace is hopelessly outdated and build fails, so I locally had to do cargo update first. That is not included in the PR.

error[E0277]: the trait bound `WebSocketStream<S>: futures_sink::Sink<Message>` is not satisfied
   --> /home/ondra/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ws_stream_tungstenite-0.14.0/src/tung_websocket.rs:145:53
    |
145 |         if ready!( Pin::new( &mut self.closer ).run( &mut self.inner, &mut self.notifier, cx) ).is_err()
    |                                                 ---       ^^^^^^^^^^ the trait `futures_sink::Sink<Message>` is not implemented for `WebSocketStream<S>`
    |                                                 |
    |                                                 required by a bound introduced by this call
    |
    = help: the following other types implement trait `futures_sink::Sink<Item>`:
              `&futures_channel::mpsc::UnboundedSender<T>` implements `futures_sink::Sink<T>`
              `&mut S` implements `futures_sink::Sink<Item>`
              `Box<S>` implements `futures_sink::Sink<Item>`
              `Buffer<Si, Item>` implements `futures_sink::Sink<Item>`
              `BufferUnordered<S>` implements `futures_sink::Sink<Item>`
              `Buffered<S>` implements `futures_sink::Sink<Item>`
              `Either<A, B>` implements `futures_sink::Sink<Item>`
              `Fanout<Si1, Si2>` implements `futures_sink::Sink<Item>`
            and 60 others
    = note: required for `&mut WebSocketStream<S>` to implement `futures_sink::Sink<Message>`
note: required by a bound in `Closer::run`
   --> /home/ondra/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ws_stream_tungstenite-0.14.0/src/tung_websocket/closer.rs:95:21
    |
 92 |     pub(super) fn run
    |                   --- required by a bound in this associated function
...
 95 |         mut socket : impl Sink<tungstenite::Message, Error=TungErr> + Unpin ,
    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Closer::run`

@giridher-art
Copy link
Collaborator

hey @MightyPork , can you specify the details of how the does this error occurs ? is this specific to a feature ?

@MightyPork
Copy link
Contributor Author

I just enabled the websocket feature and it failed to build, even standalone outside my project. We are now switched to my fork before this is fixed upstream.

#rumqttc = { version = "0.25", features = ["proxy", "websocket"] } # version = "0.25.0",
rumqttc = { git = "https://github.com/MightyPork/rumqtt", branch = "fix-websocket-build", features = ["proxy", "websocket"] } # version = "0.25.0",

@giridher-art giridher-art merged commit f334174 into bytebeamio:main Nov 17, 2025
@giridher-art
Copy link
Collaborator

giridher-art commented Nov 17, 2025

@MightyPork we will cut a new release .

thehouseisonfire pushed a commit to thehouseisonfire/rumqtt that referenced this pull request Mar 4, 2026
Fix rumqttc build with websocket feature enabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants