HTTP Kit WebSocket client
Asked Answered
S

2

8

I'm a bit confused how to create http-kit WebSocket client. On the site there is an example how to create WebSocket server, and creating client is probably trivial but I can't seem to get it right. Any examples out there which are not focused on Javascript clients?

P.S. Some discussion in this question, but only aleph example, and indication that http-kit now supports WebSocket client.

Senghor answered 23/7, 2013 at 23:32 Comment(0)
B
1

Take a look at clj-wamp . The tutorial examples worked out of box for me

% git clone https://github.com/cgmartin/clj-wamp-example.git
% cd clj-wamp-example
% lein run

[Update] This is mostly server side (although there's a javascript sample client in the tutorial). For client side you may want to check out sente and chord.

Babbie answered 5/9, 2014 at 3:52 Comment(3)
This doesn't seem to address setting up a clojure(script) websocket client, but if I'm wrong please correct me and link to the relevant documentation.Ratty
@Ratty you are about right, i've updated the answerBabbie
FWIW, chord (at the moment) only supports Clojurescript clients (see github.com/jarohen/chord/issues/40). Not sure about sente.Ratty
Z
7

There is no Websocket client support yet but there is a feature request to add client support that you could weigh in on: https://github.com/http-kit/http-kit/issues/69

Zerla answered 24/7, 2013 at 3:16 Comment(1)
Yeah. That would indeed explain why I couldn't find the correct syntax. :) Thanks.Senghor
B
1

Take a look at clj-wamp . The tutorial examples worked out of box for me

% git clone https://github.com/cgmartin/clj-wamp-example.git
% cd clj-wamp-example
% lein run

[Update] This is mostly server side (although there's a javascript sample client in the tutorial). For client side you may want to check out sente and chord.

Babbie answered 5/9, 2014 at 3:52 Comment(3)
This doesn't seem to address setting up a clojure(script) websocket client, but if I'm wrong please correct me and link to the relevant documentation.Ratty
@Ratty you are about right, i've updated the answerBabbie
FWIW, chord (at the moment) only supports Clojurescript clients (see github.com/jarohen/chord/issues/40). Not sure about sente.Ratty

© 2022 - 2024 — McMap. All rights reserved.