socket.io-client-java
socket.io-client-java copied to clipboard
feat: add connection state recovery and flexible auth
Connection State Recovery Support
Implements Socket.IO v4.6.0 connection state recovery for the Java client.
What's New
Connection State Recovery
- Client tracks session offset and PID across reconnections
- Check recovery status with
socket.isRecovered() - Get current offset with
socket.getLastOffset()
Flexible Auth (Breaking Change)
- Changed
authfromMap<String, String>toJSONObject - Now supports complex auth payloads
// Before
opts.auth = Map.of("token", "abc123");
// After
JSONObject auth = new JSONObject();
auth.put("token", "abc123");
opts.auth = auth;
Testing
- All tests updated for Socket.IO v4.8.1
- Added recovery scenario test
- Fixed namespace event issues
Works with Socket.IO v4.6+ servers that have connection state recovery enabled.