Skip to content

Conversation

@Berrysoft
Copy link
Member

  • Cleanup the code. We no longer need "connect" feature, but keep it to avoid breaking. I want to publish a 0.2.0 for compio-ws, but 0.16.2 for compio.
  • Make the exported methods the same as tokio-tungstenite.
  • There's a breaking change for MaybeTlsStream, but we haven't published it so it's OK.
  • Add flush method.

I have run the tests and the examples except the autobahn ones because I don't have docker installed.

@Berrysoft Berrysoft self-assigned this Nov 17, 2025
@Berrysoft Berrysoft added enhancement New feature or request refactor Refactoring existing code labels Nov 17, 2025
Copilot finished reviewing on behalf of Berrysoft November 17, 2025 16:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds native-tls support to the compio-ws crate and refactors TLS handling to match the tokio-tungstenite API. The changes consolidate TLS support for both native-tls and rustls into a unified module, remove deprecated code, and introduce a new flush method to the WebSocketStream.

Key Changes:

  • Unified TLS support through a new tls.rs module that handles both native-tls and rustls
  • API alignment with tokio-tungstenite, including renamed functions and updated signatures
  • Breaking change to MaybeTlsStream in compio-tls (changed from enum to struct wrapper)
  • New public flush method for WebSocketStream
  • Removal of deprecated code (stream.rs, rustls.rs, get_inner method)

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
compio/Cargo.toml Version bump to 0.16.2 and added native-tls feature propagation to compio-ws
compio-ws/Cargo.toml Version bump to 0.2.0, restructured features for native-tls and rustls support
compio-ws/src/tls.rs New unified TLS module supporting both native-tls and rustls with fallback logic
compio-ws/src/lib.rs Removed deprecated code, trait bound simplification, added flush method
compio-ws/src/stream.rs Removed deprecated module
compio-ws/src/rustls.rs Removed in favor of unified tls.rs
compio-tls/src/maybe.rs Breaking API change: MaybeTlsStream changed from public enum to struct wrapper with new_plain/new_tls constructors
compio-tls/Cargo.toml Made native-tls dependency use workspace version
compio-ws/examples/ Updated examples to use new API (TlsConnector, connect_async_tls_with_config) and switched from env_logger to tracing_subscriber
Cargo.toml Added native-tls, rustls-platform-verifier, and webpki-roots to workspace dependencies, bumped compio-ws version
compio-quic/Cargo.toml Updated dependencies to use workspace versions for rustls-platform-verifier and webpki-roots

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Berrysoft
Copy link
Member Author

compio-tls compiles even if no tls feature is enabled now.

@Berrysoft Berrysoft requested a review from Copilot November 17, 2025 17:45
Copilot finished reviewing on behalf of Berrysoft November 17, 2025 17:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@George-Miao George-Miao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Berrysoft Berrysoft merged commit e8dcfb6 into compio-rs:master Nov 17, 2025
47 checks passed
@Berrysoft Berrysoft deleted the refactor/ws branch November 17, 2025 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request refactor Refactoring existing code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants