Created
October 1, 2010 20:20
-
-
Save ztellman/606792 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
(ns scratchpad | |
(:use [aleph.core :only (siphon wrap-channel)] | |
[aleph.tcp :only (start-tcp-server)] | |
[aleph.formats :only (channel-buffer->string)])) | |
(defn echo-handler [channel connection-info] | |
(siphon (wrap-channel channel #(str "Response : " (channel-buffer->string %))) channel)) | |
;; Returns function to stop the server | |
(def server (start-tcp-server echo-handler {:port 8080})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment