Permalink
Browse files

modify readme: how to hack locally

  • Loading branch information...
1 parent 0494839 commit 0a06d0ef40494eaf8cf6811fff71fa00cafe39b3 @shenfeng shenfeng committed Mar 8, 2013
Showing with 21 additions and 1 deletion.
  1. +15 −0 README.md
  2. +1 −0 scripts/javac
  3. +3 −0 test/org/httpkit/benchmark.clj
  4. +1 −1 test/org/httpkit/client_test.clj
  5. +1 −0 test/org/httpkit/server_test.clj
View
@@ -6,6 +6,21 @@ See **[http-kit.org](http://http-kit.org)** for documentation, examples, benchma
Current [semantic](http://semver.org/) version: `[http-kit "2.0.0-RC4"]`.
+### Hack locally
+
+Hacker fridenly: only ~3k lines of code (including java), clean and tidy.
+
+```sh
+git clone git@github.com:http-kit/http-kit.git
+
+# modify as you want, unit tests back you up
+./scripts/javac with-test && lein test
+
+# may be useful. more info: server_test.clj
+./scripts/run_http_requests
+
+```
+
### Contact & Contribution
Please use the [GitHub issues page](https://github.com/http-kit/http-kit/issues) for feature suggestions, bug reports, or general discussions. Current contributors are listed [here](https://github.com/http-kit/http-kit/graphs/contributors). The http-kit.org website is also on GitHub [here](https://github.com/http-kit/http-kit.github.com).
View
@@ -6,6 +6,7 @@ CP=`lein classpath`
find src/java -name "*.java" | xargs javac -Xlint:unchecked -g -target 1.6 -source 1.6 -encoding utf8 -cp $CP -d target/classes -sourcepath src/java/
if [ $# -gt 0 ]; then
+ # lein test need it
echo "compile java test code"
find test/java -name "*.java" | xargs javac -g -Xlint:unchecked -target 1.6 -source 1.6 -encoding utf8 -cp $CP -d target/classes -sourcepath test/java
fi
@@ -7,8 +7,11 @@
{:status 200
:headers {"Content-Type" "text/plain"
"X-header" "美味书签"}
+ ;; jdk 6 is slow here, jdk7 is fine. String implemented differently
:body (subs const-string 0 1024)})
+;;; extreme case.
+;;; more real world, see server_test.clj
(defn -main [& args]
(let [[options _ banner]
(cli args
@@ -172,7 +172,7 @@
;; @(http/get "http://127.0.0.1:4348" {:headers {"Connection" "Close"}})
-;; run many HTTP request to detect any error
+;; run many HTTP request to detect any error. urls are in file /tmp/urls, one per line
;; RUN it: scripts/run_http_requests
(def chrome "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.40 Safari/537.11")
@@ -273,6 +273,7 @@
(is (= 200 (:status resp)))
(is (= (str size) (:body resp)))))
+;;; start a test server, for test or benchmark
(defonce tmp-server (atom nil))
(defn -main [& args]
(when-let [server @tmp-server]

0 comments on commit 0a06d0e

Please sign in to comment.