Liking cljdoc? Tell your friends :D

fulcro.websockets.components.channel-server


add-listenerclj

(add-listener listeners listener)
source

ajax-get-or-ws-handlerclj

source

externsclj

source

externs-neededclj

source

invokeclj

source

listenersclj

source

make-channel-serverclj

(make-channel-server &
                     {:keys [handshake-data-fn server-adapter client-id-fn
                             dependencies valid-client-id-fn transit-handlers]})

DEPRECATED! Do not use for new code. See websockets.cljc.

Creates ChannelServer.

Params:

  • handshake-data-fn (Optional) - Used by sente for adding data at the handshake.
  • server-adapter (Optional) - adapter for handling servers implemented by sente. Default is http-kit.
  • client-id-fn (Optional) - returns a client id from the request.
  • dependencies (Optional) - adds dependecies to the fulcro handler.
  • valid-client-id-fn (Optional) - Function for validating websocket clients. Expects a client-id.
  • transit-handlers (Optional) - Expects a map with :read and/or :write key containing a map of transit handlers,
DEPRECATED! Do not use for new code. See websockets.cljc.

Creates `ChannelServer`.

Params:
- `handshake-data-fn` (Optional) - Used by sente for adding data at the handshake.
- `server-adapter` (Optional) - adapter for handling servers implemented by sente. Default is http-kit.
- `client-id-fn` (Optional) - returns a client id from the request.
- `dependencies` (Optional) - adds dependecies to the fulcro handler.
- `valid-client-id-fn` (Optional) - Function for validating websocket clients. Expects a client-id.
- `transit-handlers` (Optional) - Expects a map with `:read` and/or `:write` key containing a map of transit handlers,
sourceraw docstring

message-receivedcljmultimethod

The primary multi-method to define methods for in order to receive client messages.

The primary multi-method to define methods for in order to receive client messages.
sourceraw docstring

notify-listenersclj

(notify-listeners f listeners ws-net cid)
source

post-handlerclj

source

remove-listenerclj

(remove-listener listeners listener)
source

route-handlersclj

(route-handlers {:keys [config request]} _match)

Route handler that is expected to be passed to :extra-routes when creating a Fulcro app. Route handlers will look at optionally look at :ws-origin-whitelist in your config file, and validate origins trying to make a ws connection. If :ws-origin-whitelist is nil, origins will not be checked. The :origin key will also be treated as a valid origin if checking is enabled.

Example: Both the values in :origin and :ws-origin-whitelist will pass. Any other origin will return 403.

{:origin "localhost:8080"
 :ws-origin-whitelist "www.example.io:3000"}

Origins will not be checked.

{:origin "localhost:8080"}
Route handler that is expected to be passed to `:extra-routes` when creating a Fulcro app.
Route handlers will look at optionally look at `:ws-origin-whitelist` in your config file, and
validate origins trying to make a ws connection. If `:ws-origin-whitelist` is nil, origins will
not be checked. The `:origin` key will also be treated as a valid origin if checking is enabled.

Example:
Both the values in `:origin` and `:ws-origin-whitelist` will pass. Any other origin will return 403.
```
{:origin "localhost:8080"
 :ws-origin-whitelist "www.example.io:3000"}
```

Origins will not be checked.
```
{:origin "localhost:8080"}
```
sourceraw docstring

simple-channel-serverclj

(simple-channel-server &
                       {:keys [handshake-data-fn server-adapter client-id-fn
                               dependencies valid-client-id-fn
                               transit-handlers]})

Creates a channel server that uses the default server parser (you can use defmutation, defquery-root, etc.) for incoming requests. Any dependencies you need in the parsing environment will be injected into the :ws-net entry in the parsing env. In other words: this function makes the channel server depend on your stated dependencies, and the channel server itself appears under :ws-net in the parsing env. Thus, any injected dependencies will be there as well.

Params:

  • handshake-data-fn (Optional) - Used by sente for adding data at the handshake.
  • server-adapter (Optional) - adapter for handling servers implemented by sente. Default is http-kit.
  • client-id-fn (Optional) - returns a client id from the request.
  • dependencies (Optional) - adds dependecies to the :ws-net entry in the parsing environment.
  • valid-client-id-fn (Optional) - Function for validating websocket clients. Expects a client-id.
  • transit-handlers (Optional) - Expects a map with :read and/or :write key containing a map of transit handlers,
Creates a channel server that uses the default server parser (you can use defmutation, defquery-root, etc.) for
incoming requests.  Any dependencies you need in the parsing environment will be injected into the :ws-net entry
in the parsing env. In other words: this function makes the channel server depend on your stated dependencies,
and the channel server itself appears under :ws-net in the parsing env. Thus, any injected dependencies will be
there as well.

Params:
- `handshake-data-fn` (Optional) - Used by sente for adding data at the handshake.
- `server-adapter` (Optional) - adapter for handling servers implemented by sente. Default is http-kit.
- `client-id-fn` (Optional) - returns a client id from the request.
- `dependencies` (Optional) - adds dependecies to the :ws-net entry in the parsing environment.
- `valid-client-id-fn` (Optional) - Function for validating websocket clients. Expects a client-id.
- `transit-handlers` (Optional) - Expects a map with `:read` and/or `:write` key containing a map of transit handlers,
sourceraw docstring

valid-client-id-atomclj

source

valid-client-id?clj

(valid-client-id? client-id)

Validate that the client id is a guid.

Validate that the client id is a guid.
sourceraw docstring

valid-origin?clj

(valid-origin? config request)

Validates origin based on a collection of whitelisted origin strings received from the config at :ws-origin-whitelist.

Validates origin based on a collection of whitelisted origin strings received from the config
at `:ws-origin-whitelist`.
sourceraw docstring

wrap-web-socketclj

(wrap-web-socket handler)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close