This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-29
Channels
- # aleph (2)
- # bangalore-clj (1)
- # beginners (9)
- # boot (18)
- # clara (3)
- # cljs-dev (21)
- # cljsjs (2)
- # clojure (137)
- # clojure-spec (2)
- # clojurescript (65)
- # clr (1)
- # copenhagen-clojurians (11)
- # core-async (20)
- # datascript (3)
- # lein-figwheel (1)
- # leiningen (4)
- # luminus (4)
- # lumo (1)
- # off-topic (38)
- # onyx (1)
- # parinfer (4)
- # pedestal (9)
- # protorepl (8)
- # re-frame (4)
- # reagent (92)
- # ring-swagger (2)
- # rum (1)
- # unrepl (40)
- # vim (16)
- # yada (1)
I'm trying to connect to a WAMP/ws server, but can't seem to manage:
@(http/websocket-client ws-address)
io.netty.handler.codec.http.websocketx.WebSocketHandshakeException: Invalid handshake response getStatus: 400 This server only speaks WebSocket subprotocols wamp.2.cbor.batched, wamp.2.cbor, wamp.2.msgpack.batched, wamp.2.msgpack, wamp.2.json.batched, wamp.2.json
Jul 30, 2017 1:19:51 AM clojure.tools.logging$eval1133$fn__1137 invoke
WARNING: error in websocket client
io.netty.handler.codec.http.websocketx.WebSocketHandshakeException: Invalid subprotocol. Actual: wamp.2.json. Expected one of: null
at io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker.finishHandshake(WebSocketClientHandshaker.java:237)
at aleph.http.client$websocket_client_handler$reify__19769.channelRead(client.clj:416)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
<...>
So, it seems I have to set the subprotocol (https://groups.google.com/forum/#!topic/aleph-lib/ulBaEd2YukY ?)
@(http/websocket-client ws-address {:headers {"Sec-WebSocket-Protocol" "wamp.2.json"}})
io.netty.handler.codec.http.websocketx.WebSocketHandshakeException: Invalid subprotocol. Actual: wamp.2.json. Expected one of: null
Jul 30, 2017 1:23:18 AM clojure.tools.logging$eval1133$fn__1137 invoke
WARNING: error in websocket client
io.netty.handler.codec.http.websocketx.WebSocketHandshakeException: Invalid subprotocol. Actual: wamp.2.json. Expected one of: null
at io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker.finishHandshake(WebSocketClientHandshaker.java:237)
at aleph.http.client$websocket_client_handler$reify__19769.channelRead(client.clj:416)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
<...>
Can I set the ws subprotocol using Aleph? (and how?)