Skip to content

Conversation

@fpseverino
Copy link
Owner

Resolves #4, resolves #5

@fpseverino fpseverino added the enhancement New feature or request label Jan 6, 2026
@codecov-commenter
Copy link

codecov-commenter commented Jan 6, 2026

Codecov Report

❌ Patch coverage is 84.56140% with 88 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.53%. Comparing base (bb32752) to head (b0addcd).

Files with missing lines Patch % Lines
...urces/STOMPNIO/Connection/TSTLSConfiguration.swift 69.41% 26 Missing ⚠️
...PNIO/WebSockets/STOMPWebSocketChannelHandler.swift 76.13% 21 Missing ⚠️
Sources/STOMPNIO/Connection/STOMPConnection.swift 88.88% 14 Missing ⚠️
...s/STOMPWebSocketInitialRequestChannelHandler.swift 60.00% 14 Missing ⚠️
Tests/STOMPNIOTests/STOMPConnectionTests.swift 94.26% 9 Missing ⚠️
Tests/STOMPNIOTests/STOMPNIOTests.swift 92.30% 3 Missing ⚠️
...on/STOMPConnectionConfiguration+ConfigReader.swift 96.15% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #21      +/-   ##
==========================================
- Coverage   90.04%   88.53%   -1.51%     
==========================================
  Files          25       28       +3     
  Lines        1998     2503     +505     
==========================================
+ Hits         1799     2216     +417     
- Misses        199      287      +88     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

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 PR adds WebSocket and TLS/encrypted connection support to STOMPNIO, resolving issues #4 and #5. The implementation includes custom WebSocket channel handlers, TLS configuration for both NIOSSL and NIO Transport Services, and comprehensive test coverage for WebSocket connections.

Key Changes

  • Added WebSocket support with custom channel handlers for frame handling and HTTP upgrade negotiation
  • Implemented TLS configuration supporting both NIOSSL (macOS/Linux) and NIO Transport Services (iOS/tvOS/watchOS)
  • Extended test suite to validate WebSocket connections with parameterized tests across different configurations

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
Sources/STOMPNIO/WebSockets/STOMPWebSocketInitialRequestChannelHandler.swift New handler for WebSocket HTTP upgrade handshake with STOMP protocol negotiation
Sources/STOMPNIO/WebSockets/STOMPWebSocketChannelHandler.swift New duplex handler for WebSocket frame encoding/decoding and connection management
Sources/STOMPNIO/Connection/TSTLSConfiguration.swift New TLS configuration for NIO Transport Services (adapted from MQTTNIO)
Sources/STOMPNIO/Connection/STOMPConnectionConfiguration.swift Added TLS and WebSocket configuration structures with initialization and documentation
Sources/STOMPNIO/Connection/STOMPConnectionConfiguration+ConfigReader.swift Extended config reader to support WebSocket parameters and HTTP headers
Sources/STOMPNIO/Connection/STOMPConnection.swift Refactored bootstrap creation to support TLS and WebSocket with platform-specific handling
Sources/STOMPNIO/STOMPClientError.swift Added new error cases for TLS misconfiguration and WebSocket upgrade failures
Sources/STOMPNIO/Utils/StringProtocol+trimmingWhitespace.swift Refactored to work on StringProtocol instead of concrete String/Substring types
Tests/STOMPNIOTests/STOMPNIOTests.swift Added WebSocket initial request handler tests and updated StringProtocol tests
Tests/STOMPNIOTests/STOMPConnectionTests.swift Parameterized existing tests to run with both TCP and WebSocket connections
Package.swift Added swift-nio-ssl, NIOWebSocket, and NIOHTTP1 dependencies
README.md Updated feature list to reflect TLS and WebSocket support
Notice.txt Added attribution for WebSocket and TLS code derived from MQTTNIO
RabbitMQ/enabled_plugins Enabled rabbitmq_web_stomp plugin for WebSocket testing
.github/workflows/ci.yml Updated CI workflow to enable WebSocket plugin in RabbitMQ

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

case timeout
/// You have provided the wrong TLS configuration for the EventLoopGroup you provided
case wrongTLSConfig
case websocketUpgradeFailed
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

The error case websocketUpgradeFailed lacks documentation. All other error cases in this enum have documentation comments explaining their purpose. Consider adding a doc comment like "/// WebSocket upgrade failed during connection establishment".

Copilot uses AI. Check for mistakes.
public static let timeout = Self(.timeout)
/// You have provided the wrong TLS configuration for the EventLoopGroup you provided
public static let wrongTLSConfig = Self(.wrongTLSConfig)
public static let websocketUpgradeFailed = Self(.websocketUpgradeFailed)
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

The error case websocketUpgradeFailed lacks documentation. All other error cases in this section have documentation comments. Consider adding a doc comment like "/// WebSocket upgrade failed during connection establishment".

Copilot uses AI. Check for mistakes.
/// You have provided the wrong TLS configuration for the EventLoopGroup you provided
public static let wrongTLSConfig = Self(errorType: .wrongTLSConfig)

public static let websocketUpgradeFailed = Self(errorType: .websocketUpgradeFailed)
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

The error case websocketUpgradeFailed lacks documentation. All other error cases in this section have documentation comments. Consider adding a doc comment like "/// WebSocket upgrade failed during connection establishment".

Copilot uses AI. Check for mistakes.
Copy link

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 27 out of 29 changed files in this pull request and generated 5 comments.


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

/// Connection closed because it timed out while waiting for RECEIPT or CONNECTED frame
public static let timeout = Self(.timeout)
/// You have provided the wrong TLS configuration for the EventLoopGroup you provided
public static let wrongTLSConfig = Self(.wrongTLSConfig)
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

The websocketUpgradeFailed static property is missing documentation comments. All other static properties in this file have documentation comments. Please add a documentation comment for consistency.

Suggested change
public static let wrongTLSConfig = Self(.wrongTLSConfig)
public static let wrongTLSConfig = Self(.wrongTLSConfig)
/// The WebSocket upgrade handshake failed

Copilot uses AI. Check for mistakes.
@fpseverino fpseverino marked this pull request as ready for review January 8, 2026 10:34
@fpseverino fpseverino merged commit 533bb02 into main Jan 8, 2026
5 of 6 checks passed
@fpseverino fpseverino deleted the websocket branch January 8, 2026 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TLS WebSockets

3 participants