Skip to content

Commit

Permalink
Add docs for using proxy to README, and add mising test. (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
sundbp authored Apr 10, 2020
1 parent 959d26e commit dd4e9c8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,13 @@ The `-Sdeps-file` option may be used to load a different project file than `dep

### Proxy environment variables

TODO
deps.clj supports setting a proxy server via the "standard" environment variables (the lowercase versions are tried first):
- `http_proxy` or `HTTP_PROXY` for http traffic
- `https_proxy` or `HTTPs_PROXY` for https traffic

This will set the JVM properties `-Dhttp[s].proxyHost` and `-Dhttp[s].proxyPort`.

The format of the proxy string supported is `http[s]://[username:password@]host:port`. Any username and password info is ignored as not supported by the underlying JVM properties.

## Developing deps.clj

Expand Down
7 changes: 5 additions & 2 deletions test/borkdude/deps_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@
"org.clojure/clojure")))

(deftest jvm-proxy-settings-test
;; TODO:
#_(is (= "..." (deps/parse-proxy-info "..."))))
(is (= {:host "aHost" :port "1234"} (deps/parse-proxy-info "http://aHost:1234")))
(is (= {:host "aHost" :port "1234"} (deps/parse-proxy-info "http://user:pw@aHost:1234")))
(is (= {:host "aHost" :port "1234"} (deps/parse-proxy-info "https://aHost:1234")))
(is (= {:host "aHost" :port "1234"} (deps/parse-proxy-info "https://user:pw@aHost:1234")))
(is (nil? (deps/parse-proxy-info "http://aHost:abc"))))

0 comments on commit dd4e9c8

Please sign in to comment.