socket.io-client-java icon indicating copy to clipboard operation
socket.io-client-java copied to clipboard

feat: add connection state recovery and flexible auth

Open RobinPcrd opened this issue 1 month ago • 0 comments

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 auth from Map<String, String> to JSONObject
  • 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.

RobinPcrd avatar Dec 03 '25 15:12 RobinPcrd