// the find
TooTallNate/Java-WebSocket
A barebones WebSocket client and server implementation written in 100% Java.
A pure-Java WebSocket client and server library built on java.nio for non-blocking I/O. It's been around long enough to accumulate real-world fixes — the issue-named test files tell that story — and it's the go-to choice when you need WebSockets in a plain Java or Android project without pulling in a full framework like Netty or Vert.x. RFC 6455 compliant with permessage-deflate support.
Autobahn test suite results are included in the repo, which means protocol conformance is actually verified, not just claimed. The extension system is properly abstracted — plugging in permessage-deflate is a few lines, not a fork. SSL setup has multiple factory options including custom SSLContext and two-way TLS, covering the cases that most similar libs leave as an exercise for the reader. Zero mandatory dependencies beyond SLF4J, so it won't blow up your dependency graph.
You can't accept both ws:// and wss:// on the same server instance — a genuine architectural limitation that forces you to run two servers or put a TLS terminator in front. The client reconnect story is just an example file, not a first-class API, so you're writing your own reconnect loop with backoff. The threading model hands you a single selector thread per server, which means a slow onMessage callback blocks message delivery for all connected clients — not obvious until you're under load. Last stable release is 1.6.0 from a couple years back; the repo is maintained but not actively developed, so if you hit an edge case you're likely patching it yourself.