Created
August 10, 2015 13:03
-
-
Save jcrossley3/36f9509c9d3375ed39c8 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 ^ServerContainer server-container [^ServletContext context] | |
(.getAttribute context "javax.websocket.server.ServerContainer")) | |
(defn add-endpoint | |
"Adds an endpoint to a container obtained from the servlet-context" | |
[^ServletContext servlet-context {:keys [path handshake] :or {path "/"}}] | |
(.addEndpoint (server-container servlet-context) | |
(.. ServerEndpointConfig$Builder | |
(create DelegatingJavaxEndpoint path) | |
(configurator (proxy [ServerEndpointConfig$Configurator] [] | |
(getEndpointInstance [_] (DelegatingJavaxEndpoint.)) | |
(modifyHandshake [_ _ _] | |
(when handshake | |
(handshake | |
(.get WebSocketHelpyHelpertonFilter/requestTL)))))) | |
build))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment