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
1
vote
1 answer

Timeout with Python Requests + Clojure HttpKit Server but not Ring server

I have some Ring routes which I'm running one of two ways. lein ring server, with the lein-ring plugin using org.httpkit.server, like (hs/run-server app {:port 3000})) It's a web app (being consumed by an Angular.js browser client). I have some…
Joe
  • 46,419
  • 33
  • 155
  • 245
1
vote
2 answers

http-kit what is the difference between sending response through channel and just return a map

As the title says. What is the difference between sending response through a channel and just return a map. (defn handler-one [request] (response "hello world") (defn handler-two [request] (with-channel request channel (send! channel…
Faris Nasution
  • 3,450
  • 5
  • 24
  • 29
1
vote
1 answer

Jetty threads getting blocked and dead locked

I am using jetty "7.6.8.v20121106" as a part of https://github.com/ring-clojure/ring/tree/master/ring-jetty-adapter with my server. I am making calls using http://http-kit.org/ with following code. Essentially I am making server calls but ignoring…
Andy P
  • 814
  • 6
  • 16
0
votes
0 answers

Clojure httpkit spotify request

Following my last question, but to keep the code homogeneous I want to use httpkit to make requests instead of clj-http as I did before. I have the following to try and receive my profile from the Spotify API: (defn get-me [token] …
Jack Gee
  • 136
  • 6
0
votes
1 answer

How do I invoke a resolved function in a Compojure view?

I have the following code as a test: (defn test-fn [] (println "This is a test")) (def my-test "test") ((resolve (symbol (str my-test "-fn")))) Which runs as I would expect producing This is a test. So I put it inside of a separate view like…
Darrell Brogdon
  • 6,843
  • 9
  • 47
  • 62
0
votes
1 answer

How do you send api-key as authorization with http-kit in Clojure?

I need to make an API call with http-kit in Clojure where it uses API-Key as authorization. That is, in Postman, you would usually have the option to add an api-key, api-value and the option to add it to header or query-params. I know the following…
Dipti
  • 85
  • 2
  • 9
0
votes
1 answer

How to have ring requests timeout after X seconds?

Is there any way to make requests to my server automatically time out (on the server) after X seconds? I want to do this because on heroku requests time out after 30 seconds, and I don't want to waste server resources on computing responses in these…
rutchkiwi
  • 427
  • 3
  • 14
0
votes
1 answer

How to write a response directly in http-kit?

how do I write a response directly in http-kit? I'm building a tunneling proxy and need the very first response to be exactly "HTTP/1.1 200 Connection established\r\n\r\n", but it seems http-kit renders that as a body, even if I do something like…
AlanAdams
  • 73
  • 1
0
votes
1 answer

Getting POSTed data in a Clojure / Ring / HttpKit application

I'm writing a simple HttpKit / Ring application and am trying to post some data from a form to it. Here's the relevant part of my server code : (defn save-page [request] (let [qs (:query-string request) fp (:form-params request)] …
interstar
  • 26,048
  • 36
  • 112
  • 180
0
votes
1 answer

How to pass data with GET request?

I want to pass form data with GET request. I have success with this curl: curl http://sample.com -d 'action=login_request&user_name=balvan' but I need to pass that same stuff from -d. with this function call: (http-client/request …
user11274258
0
votes
1 answer

Making an AJAX call when hosting on Localhost for HTTP-Kit

I am trying to make a front end and HTTP-Kit backend website. I ran into a lot of trouble with getting a response from the HTTP-Kit from within the web browser. When I access 'http://localhost:8080 from my we browser using HTTP-Kit webserver it…
phlie
  • 1,335
  • 3
  • 10
  • 19
0
votes
1 answer

Pinging client with Websocket server

I have a Websocket connection being served from http-kit (Clojure, and it works great). I send pings from the client to make sure we're still connected, and everything works fine there. My question is, do people bother pinging client from server in…
TrivialCase
  • 1,060
  • 2
  • 14
  • 27
0
votes
1 answer

HTTPKit gives ProtocolException: "No status" for a Let's Encrypt site

I'm trying to retrieve a URL. At the time of writing: https://upvote.pub/ Using the java.net.URL, I can retrieve this fine: => (count (slurp (.openStream (java.net.URL. "https://upvote.pub/")))) 44353 Ditto clj-http: => (count (:body…
Joe
  • 46,419
  • 33
  • 155
  • 245
0
votes
1 answer

Threads parked with HTTP-Kit

I have a few threads on the go, each of which make a blocking call to HTTP Kit. My code's been working but has recently taken to freezing after about 30 minutes. All of my threads are stuck at the following point: sun.misc.Unsafe.park(Native…
Joe
  • 46,419
  • 33
  • 155
  • 245
0
votes
2 answers

Clojure http-kit get request stuck on multiple async calls

I have created small example which highlight the problem: (->> (range 0 4) (mapv (fn [i] (http/get "http://http-kit.org/" (fn [res] (info "first callback") …
Sergiy Kozachenko
  • 1,399
  • 11
  • 31