Permalink
Browse files

support both socket and non-socket connections

  • Loading branch information...
ztellman committed Jan 25, 2012
1 parent aa55023 commit d648148241bcb69ca3ecb7fec997bc4a8b831dee
Showing with 8 additions and 6 deletions.
  1. +7 −6 src/aleph/http/websocket.clj
  2. +1 −0 test/aleph/test/http.clj
@@ -41,12 +41,13 @@
(set! *warn-on-reflection* true)
(defn create-handshaker [^HttpRequest req]
(->
(WebSocketServerHandshakerFactory.
(str "ws://" (.getHeaders req "Host") (.getUri req))
nil
false)
(.newHandshaker req)))
(when (= "Upgrade" (.getHeader req "Connection"))
(->
(WebSocketServerHandshakerFactory.
(str "ws://" (.getHeaders req "Host") (.getUri req))
nil
false)
(.newHandshaker req))))
(defn automatic-reply [^Channel ch ^WebSocketServerHandshaker handshaker ^WebSocketFrame frame]
(cond
View
@@ -148,6 +148,7 @@
;;:results log-info
:errors nil-channel
}
:websocket true
:auto-transform true
})
~@body))

0 comments on commit d648148

Please sign in to comment.