Guest User

Untitled

a guest
Jun 13th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. (ns scratchpad
  2. (:use [aleph.core :only (siphon wrap-channel)]
  3. [aleph.tcp :only (start-tcp-server)]
  4. [aleph.formats :only (channel-buffer->string)]))
  5.  
  6. (defn echo-handler [channel connection-info]
  7. (siphon (wrap-channel channel #(str "Response : " (channel-buffer->string %))) channel))
  8.  
  9. ;; Returns function to stop the server
  10. (def server (start-tcp-server echo-handler {:port 8080}))
Add Comment
Please, Sign In to add comment