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:
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).
(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.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |