Created
July 6, 2013 20:49
-
-
Save cgmartin/5941239 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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