Skip to content

Instantly share code, notes, and snippets.

@cgmartin
Created July 6, 2013 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cgmartin/5941239 to your computer and use it in GitHub Desktop.
Save cgmartin/5941239 to your computer and use it in GitHub Desktop.
(defn rpc-url [path] (str "http://wamptutorial/rpc#" path))
(defn evt-url [path] (str "http://wamptutorial/event#" path))
(defn auth-secret [sess-id auth-key extra]
"secret-password") ; from database
(defn auth-permissions [sess-id auth-key}
; get permissions for this user
{:rpc {(rpc-url "echo") true}
:subscribe {(evt-url "chat") true}
:publish {(evt-url "chat") true}})
(defn wamp-handler
; ...
(clj-wamp/http-kit-handler channel
{:on-auth {:secret auth-secret
:permissions auth-permissions}})
; ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment