WebSockets Using Sente
Now that we have some familiarity with how WebSockets work, let’s take a look at using the Sente library, which provides a number of useful features, as seen in the following list.
Ajax fallback support—Automatically falls back to using Ajax polling when WebSockets are not available
keep-alives—Ensures the connection is not dropped
buffering—Provides internal buffering for messages
data encoding—Takes care of serializing and deserializing the message data
Ring security—Is compatible with Ring anti-forgery middleware
Update the Server
Let’s start by adding the Sente dependencies in the project.clj file.
We can now update the guestbook.routes.ws namespace to use ...