Questions tagged [http-kit]

HTTP Kit is a minimalist, efficient, Ring-compatible HTTP client/server for Clojure. It uses a event-driven architecture to support highly concurrent a/synchronous web applications. Feature a unified API for WebSocket and HTTP long polling/streaming.

HTTP Kit is a minimalist, efficient, Ring-compatible HTTP client/server for Clojure. It uses a event-driven architecture to support highly concurrent a/synchronous web applications. Feature a unified API for WebSocket and HTTP long polling/streaming

Information from: http://http-kit.org/

68 questions
37
votes
1 answer

Can I make a fully non-blocking backend application with http-kit and core.async?

I'm wondering if it's possible to put together a fully non-blocking Clojure backend web application with http-kit. (Actually any Ring-compatible http server would be fine by me; I'm mentioning http-kit because it claims to have an event-driven,…
Valentin Waeselynck
  • 5,950
  • 26
  • 43
10
votes
2 answers

How do I make a large number of concurrent HTTPS requests robustly in Clojure (/Java)

I have a stream of inputs and I want to make 2 HTTPS network requests for each before passing the result on to another part of the program. The typical throughput is 50 per second. for each input: HTTP request A HTTP request B pass event…
Joe
  • 46,419
  • 33
  • 155
  • 245
9
votes
1 answer

Is it sane to use core.async channels to consume http-kit's post results in clojure?

I am new to clojure and am writing a library that sends post results to a server for a response. I consume the response by placing it onto a core.async channel. Is this sane or is there a better way? Here is a high level overview of what I am…
gilmaso
  • 219
  • 4
  • 8
8
votes
2 answers

HTTP Kit WebSocket client

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…
Domchi
  • 10,705
  • 6
  • 54
  • 64
5
votes
1 answer

Streaming connection / long polling with HTTP Kit?

I'm trying to consume an HTTP streaming connection that never closes (it's the Gnip Compliance stream). I want to work with HTTP Kit, but I can't get it to work. If I pass the :stream argument: @(http/get "http://example.com/stream-connection" {:as…
Joe
  • 46,419
  • 33
  • 155
  • 245
5
votes
2 answers

HTTP streaming / chunked responses on Heroku with clojure

I'm making a clojure web app that streams data to clients using chunked HTTP responses. This works great when I run it locally using foreman, but doesn't work properly when I deploy it to Heroku. A minimal example exhibiting this behaviour can be…
rufo
  • 61
  • 5
4
votes
1 answer

Is there a way to see the requests generated by http-kit?

I'm working on an application that uses the http-kit client library and I think it's generating requests that have a problem. Since the requests go over https, I can't just sniff them and I also couldn't find a way to make http-kit use a proxy, such…
Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622
4
votes
1 answer

How to identify that the http-kit client callback is invoked due to timeout?

For Example: (:require [org.httpkit.client :as http]) (defn post-callback [] ;; how to know if it is due to timeout? ) (def options {:body "abc" :timeout 1000}) (http/post "some-url" options post-callback) If the "some-url" is down, then on…
4
votes
2 answers

Clojure: I am using http-kit to post a request to a server, but it is not working well for me

NOTE: I resolved my issue. However, it took a number of incremental changes. If you happen upon this page, feel free to checkout my github below to see how I made this application work. I am using http-kit to post a request to btc-china. I want to…
gilmaso
  • 219
  • 4
  • 8
3
votes
1 answer

Can the ring-anti-forgery middleware be applied conditionally?

We have a web application that uses HttpKit to serve requests and a handler wrapped with Ring middleware. The handler is similar to: (def handler (-> #'req-handler (wrap-defaults site-defaults) (wrap-content-type-and-encoding) …
Jacob
  • 1,886
  • 2
  • 25
  • 40
3
votes
1 answer

Clojure Web (HttpKit, Manifold) vs Elixir/Pheonix

I am currently weighing up the use of Elixir vs Clojure for running a web server to handle many concurrent Web socket connections. Now Elixir/Phoenix seems a natural fit for this and you see benchmarks demonstrating how far it scales (I doubt this…
Jim10o90
  • 43
  • 3
3
votes
1 answer

Registering multiple handlers while running server

Is there any way to register multiple handlers while running an http-kit server: (defroutes rest-main-app (GET "/" "Welcome")) (defroutes rest-events-app (GET "/events" "Event API")) (defn -main [] (run-server rest-main-app {:port…
Erhan Bagdemir
  • 5,231
  • 6
  • 34
  • 40
3
votes
0 answers

http-kit Clojure and Gloss - Insufficient bytes to decode frame

I am using HTTP-KIT for write a simple server and client HTTP. And now I want to send some data encoded using gloss. My gloss code is something like this: (gcore/defcodec sized-string (gcore/finite-frame :uint16-be …
Édipo Féderle
  • 4,169
  • 5
  • 31
  • 35
3
votes
0 answers

Deploying a clojure / http-kit application with tomcat7

Short story: I'm trying to deploy on tomcat7 an application built with the http-kit template here, but the third step is a command (sh java -jar target/lein-template-standalone.jar --profile prod --port 8000) and I have absolutely no idea what to do…
Suugaku
  • 2,667
  • 5
  • 31
  • 33
3
votes
1 answer

Scalable Chat server in Clojure. Problems with presence and message arrival b/w reconnections

I am trying to build a scalable chat server in Clojure. I am using http-kit, compojure and redis pub/sub to communicate between diffrent nodes (fan-out approach). The server will use websockets for connection b/w client-server with a fallback to…
Suhail Ansari
  • 137
  • 1
  • 6
1
2 3 4 5