Add WebTransport integration to Socket.IO Java client#791
Open
bneigher wants to merge 4 commits intosocketio:mainfrom
Open
Add WebTransport integration to Socket.IO Java client#791bneigher wants to merge 4 commits intosocketio:mainfrom
bneigher wants to merge 4 commits intosocketio:mainfrom
Conversation
- Update Java version from 1.7 to 17 for modern HTTP/3 support - Add comprehensive WebTransport integration test suite (12 test cases) - Add WebTransport configuration options in Manager.java - Add WebTransport fluent API methods in SocketOptionBuilder.java - Add WebTransport usage documentation and examples - Test WebTransport transport selection and fallback behavior - Test WebTransport with namespaces and multiple connections - Maintain full backward compatibility Features: - Transport selection testing (WebTransport-only and fallback scenarios) - Event handling integration with Socket.IO events - Configuration testing for WebTransport-specific options - Timeout handling and error scenario testing - Multiple connection and namespace support testing This PR enables Socket.IO Java client to support WebTransport through the Engine.IO client dependency and provides comprehensive testing for WebTransport integration scenarios.
added 3 commits
September 24, 2025 15:51
- Remove outdated 'Temporarily commented out until correct dependencies are found' comments - Replace with clear comment explaining WebTransport support comes from Engine.IO client - These comments were from earlier attempts before implementing WebTransport in Engine.IO client
…tions
This commit simplifies WebTransport configuration to be consistent with other
transports (WebSocket, Polling) and removes the confusing dual-layer configuration
that was previously required.
### Changes Made:
**Removed Redundant Configuration Layer:**
- Removed WebTransportOptions class from Manager.Options
- Removed all WebTransport-specific setters from SocketOptionBuilder:
- setWebTransportOptions()
- setWebTransportEnabled()
- setWebTransportConnectTimeout()
- setWebTransportIdleTimeout()
- setWebTransportTrustAllCertificates()
- setWebTransportSslContext()
- setWebTransportCustomHeaders()
**Simplified Configuration Approach:**
- WebTransport now configured exactly like WebSocket and Polling
- Single configuration layer through Engine.IO transport options
- Consistent API across all transport types
**Updated Documentation:**
- Comprehensive WebTransport documentation with practical examples
- Clear explanation of transport-specific options for advanced use cases
- SSL configuration examples for development with self-signed certificates
- Emphasis on consistent configuration approach
- Updated webtransport_example.md with all new patterns
### Before (Confusing):
```java
// Dual-layer configuration - REMOVED
IO.Options options = IO.Options.builder()
.setWebTransportEnabled(true)
.setWebTransportConnectTimeout(30000)
.setWebTransportTrustAllCertificates(true)
.build();
```
### After (Consistent):
```java
// Simple, consistent with other transports
IO.Options options = IO.Options.builder()
.setTransports(new String[]{"webtransport", "websocket", "polling"})
.build();
// Advanced options when needed (same pattern as WebSocket/Polling)
Transport.Options webTransportOptions = new Transport.Options();
webTransportOptions.hostname = "127.0.0.1";
options.transportOptions.put("webtransport", webTransportOptions);
```
### Benefits:
- **Consistency**: WebTransport configured like other transports
- **Simplicity**: Single configuration approach, no dual layers
- **Maintainability**: Reduced code complexity and API surface
- **User Experience**: Intuitive configuration matching existing patterns
This change makes WebTransport a first-class transport that follows the same
patterns as WebSocket and Polling, eliminating confusion and reducing the
learning curve for developers.
Breaking Change: Removes WebTransport-specific configuration methods
Migration: Use .setTransports() and transportOptions like other transports
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add WebTransport Support to Socket.IO Java Client
This PR adds comprehensive WebTransport support to the Socket.IO Java client ecosystem, enabling modern HTTP/3-based real-time communication with automatic fallback to traditional transports.
🚀 Overview
WebTransport is a modern transport protocol based on HTTP/3 and QUIC that provides improved performance, reduced latency, and better handling of network conditions compared to traditional WebSocket connections.
This implementation provides production-ready WebTransport support with seamless fallback behavior.
📦 Changes Summary
Engine.IO Client (
engine.io-client-java)jetty-quiche-nativedependency for native QUIC protocol supporttryNextTransport()methodSocket.EVENT_ERRORemission when all transports failSocket.IO Client (
socket.io-client-java)🔧 Technical Implementation
Dependencies Added
jetty-quiche-nativeKey Features
📋 Usage
🧪 Testing
🔄 Migration Guide
Before (Complex, Inconsistent)
After (Simple, Consistent)
✅ Compatibility
Socket.EVENT_ERRORemission🎯 Benefits
🏗️ Architecture Improvements
tryNextTransport()Socket.EVENT_ERRORemissionreadyStatehandling throughout transport lifecycle📌 Notes
✅ This implementation provides a robust, production-ready WebTransport solution that gracefully falls back to traditional transports when WebTransport is unavailable, ensuring maximum compatibility and reliability for Socket.IO Java applications.