Questions tagged [sente]

For questions regarding the Sente web socket Clojure(Script) library.

Sente is a library in/for Clojure and ClojureScript for implementing websocket communication with AJAX fallback.

Features

  • Bidirectional a/sync comms over both WebSockets and Ajax (auto-fallback)
  • It just works: auto keep-alives, buffering, protocol selection, reconnects
  • Efficient design incl. transparent event batching for low-bandwidth use, even over Ajax
  • Send arbitrary Clojure vals over edn or Transit (JSON, MessagePack, etc.)
  • Tiny API: make-channel-socket! and you're good to go
  • Automatic, sensible support for users connected with multiple clients and/or devices simultaneously
  • Realtime info on which users are connected over which protocols (v0.10.0+)
  • Flexible model: use it anywhere you'd use WebSockets/Ajax/Socket.IO, etc.
  • Standard Ring security model: auth as you like, HTTPS when available, CSRF support, etc.
  • Fully documented, with examples
  • Small codebase: ~1.5k lines for the entire client+server implementation
  • Supported servers: http-kit, Immutant v2+, nginx-clojure, node.js, Aleph

For more information: https://github.com/ptaoussanis/sente

7 questions
3
votes
2 answers

Full-Stack Clojure: How to get a Browser REPL and a Server REPL simultaneously during development

I'm developing my first full-stack Clojure application. I've managed to get the following working properly in Linux Mint: leiningen figwheel + garden[auto] = Interactive SPA development with hot code and CSS reloading leiningen REPL for Server with…
2
votes
1 answer

Non-stop requests over sente web-socket channel for what should be a single request

The goal is to allow someone to update the status of an online exam in real time. (IE. Pressing Activate Charlie's exam, changes Charlies screen to allow him to start taking his exam. The relationship between the proctor is one proctor to many…
2
votes
2 answers

Invalid event "~#chsk/handshake" when using sente packers.transit/get-transit-packer in clojure

I am getting an error when using sente that results in failure while sending information from client to server or vice versa. The problem seems to be that the handshake fails with an error cljs$core$ExceptionInfo message: "Invalid event" data:…
Ike Mawira
  • 751
  • 11
  • 21
1
vote
1 answer

Clojurescript Websockets with Sente 403 Error

I'm attempting to setup a web socket connection from two different ports on my localhost. I'm using Sente and Immutant. I have the following, but it returns a 403 forbidden when attempting to connect Server.clj (defn handler "Comment" [] …
newBieDev
  • 484
  • 3
  • 11
1
vote
0 answers

http-kit dependency issue when updating sente-boot

Likely something wrong with my updated build.boot file: https://github.com/laforge49/sente-boot/blob/master/build.boot (Been on the backend too long!) I've tried changing the version of clojure and clojurescript. Previously I was not finding class…
1
vote
1 answer

Why does Sente's ring-req have the cookie but not the session?

I'm using the Sente library for communicating over websockets. The communication is already working but the session seem to be missing. I'm setting up Sente like this: ;; According to https://github.com/ptaoussanis/sente (let [{:keys [ch-recv…
Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622
0
votes
1 answer

Can Sente be used in a server-only configuration?

I'm looking to replace an existing Websocket-based server with a new version written in Clojure. It seems like the Sente library might be an appropriate choice for this. One thing that isn't clear to me, however, is to what extent Sente relies on a…
Derek Thurn
  • 14,953
  • 9
  • 42
  • 64