- Notifications
You must be signed in to change notification settings - Fork982
Add WebTransport integration to Socket.IO Java client#791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Open
bneigher wants to merge4 commits intosocketio:mainChoose a base branch frombneigher:feat/webtransport
base:main
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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
- 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 compatibilityFeatures:- 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 testingThis PR enables Socket.IO Java client to support WebTransportthrough the Engine.IO client dependency and provides comprehensivetesting for WebTransport integration scenarios.
- 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
…tionsThis commit simplifies WebTransport configuration to be consistent with othertransports (WebSocket, Polling) and removes the confusing dual-layer configurationthat 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 - REMOVEDIO.Options options = IO.Options.builder() .setWebTransportEnabled(true) .setWebTransportConnectTimeout(30000) .setWebTransportTrustAllCertificates(true) .build();```### After (Consistent):```java// Simple, consistent with other transportsIO.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 patternsThis change makes WebTransport a first-class transport that follows the samepatterns as WebSocket and Polling, eliminating confusion and reducing thelearning curve for developers.Breaking Change: Removes WebTransport-specific configuration methodsMigration: Use .setTransports() and transportOptions like other transportsSign up for freeto 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.
Uh oh!
There was an error while loading.Please reload this page.
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 onHTTP/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 arobust, 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.