Skip to content

Instantly share code, notes, and snippets.

@ztellman
Created September 29, 2010 22:52
Show Gist options
  • Save ztellman/603718 to your computer and use it in GitHub Desktop.
Save ztellman/603718 to your computer and use it in GitHub Desktop.
(use 'aleph.http 'aleph.tcp 'aleph.formats)
(defn websocket-handler [websocket-channel _]
(let [client (tcp-client {:host "message-broker" :port 10000})]
(run-pipeline client
(fn [client-channel]
(siphon (wrap-channel websocket-channel string->channel-buffer) client-channel)
(siphon (wrap-channel client-channel channel-buffer->string) websocket-channel)))))
(start-http-server websocket-handler {:websocket true, :port 8080})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment