0

In this url, it shows how to use proxy in clj-http

https://github.com/dakrone/clj-http

(client/get "http://foo.com" {:proxy-host "127.0.0.1" :proxy-port 8118})

But since we could have http proxy or https proxy, how to specify http or https? or it's mart enough to pickup the right now without the need to give http or https?

Daniel Wu
  • 5,853
  • 12
  • 42
  • 93

1 Answers1

0

You are using the per-request api, so you manually choose if the request has to use a proxy or not, so for that particular request it will always use a proxy no matter if it is http or https

DanLebrero
  • 8,545
  • 1
  • 29
  • 30
  • I meant how the tell it to use http or https. You know there are many types of proxy, 2 of them are http and https, so how to use the api to select http or https – Daniel Wu Jan 27 '16 at 14:10
  • From https://github.com/dakrone/clj-http/blob/cc6f407033f65d7a22a18d65f3850e1424d35664/src/clj_http/core_old.clj#L91 it seems that it uses (getScheme target), so http for http, https for https – DanLebrero Jan 27 '16 at 16:31