9

WebSockets

Traditionally, web applications have been developed using the request/response model followed by HTTP. In this traditional request/response model, the request is always initiated by the client, then the server sends a response back to the client.

There has never been any way for the server to send data to the client independently, that is, without having to wait for a request, until now. The WebSocket protocol allows full-duplex, two-way communication between the client (browser) and the server.

The Jakarta API for WebSocket allows us to develop WebSocket endpoints in Java.

In this chapter, we will cover the following topics:

  • Developing WebSocket server endpoints
  • Developing WebSocket clients in JavaScript
  • Developing WebSocket clients ...

Get Jakarta EE Application Development - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.