Skip to content
Kurtis Rainbolt-Greene edited this page Jun 5, 2023 · 6 revisions

Making request behind proxy is as simple as making them directly. Just specify hostname (or IP address) of your proxy server and its port, and here you go:

HTTP.via("proxy-hostname.local", 8080)
  .get("http://example.com/resource")

Proxy needs authentication? No problem:

HTTP.via("proxy-hostname.local", 8080, "username", "password")
  .get("http://example.com/resource")

What if you want to pass in special headers instead?

HTTP.via("proxy-hostname.local", 8080, {"Proxy-Authorization" => "gh-token:asxkdmaojsdnakjnmf3iem3imdf2qoimo324"})
  .get("http://example.com/resource")
Clone this wiki locally