Liking cljdoc? Tell your friends :D

taoensso.sente.server-adapters.community.express

Sente server adapter for Node.js with Express, Ref. https://github.com/expressjs/express.

This adapter works differently that the others as Sente is expecting Ring requests but Express uses http.IncomingMessage. While most of this adapter could be used for similar implementations there will be assumptions here that the following express middleware (or equivalents) are in place:

  • cookie-parser
  • body-parser
  • csurf
  • express-session
  • express-ws

See the example project at https://goo.gl/lnkiqS for an implementation (it's a bit different than something built on Ring).

Sente server adapter for Node.js with Express,
Ref. <https://github.com/expressjs/express>.

This adapter works differently that the others as Sente is
expecting Ring requests but Express uses http.IncomingMessage.
While most of this adapter could be used for similar
implementations there will be assumptions here that the following
express middleware (or equivalents) are in place:
  - cookie-parser
  - body-parser
  - csurf
  - express-session
  - express-ws

See the example project at https://goo.gl/lnkiqS for an
implementation (it's a bit different than something built on Ring).
raw docstring

make-express-channel-socket-server!cljs

(make-express-channel-socket-server! & [opts])

A customized make-channel-socket-server! that uses Node.js with Express as the web server.

The default CSRF policy relies on upstream csurf validation. Since csurf commonly ignores GET requests, WebSocket handshakes must also be protected by configuring csurf to check GET or by setting Sente's :allowed-origins to the application's trusted origins. A custom :csrf-token-fn in opts replaces this default.

A customized `make-channel-socket-server!` that uses Node.js with
Express as the web server.

The default CSRF policy relies on upstream `csurf` validation. Since `csurf`
commonly ignores GET requests, WebSocket handshakes must also be protected by
configuring `csurf` to check GET or by setting Sente's `:allowed-origins` to
the application's trusted origins. A custom `:csrf-token-fn` in `opts`
replaces this default.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close