In Ruby’s httpclient gem, the optional first argument to HTTPClient.new identifies a proxy. It is not the website the client should fetch.

require "httpclient"

client = HTTPClient.new("http://proxy.example.net:8080")
response = client.get("https://example.com/")

The constructor chooses the intermediary, including a public endpoint selected from the HTTP proxy list; get receives the destination. Passing a website URL to new can make the library interpret that website as a proxy and report an unsupported-proxy error.

If no explicit proxy is intended, construct HTTPClient.new without a destination argument and pass the URL on the request. Also inspect the environment proxy values used by the gem when diagnosing an unexpected route.

For a proxy account, the client exposes set_proxy_auth(user, password). This belongs to the intermediary’s authentication setup rather than the destination URL.

Аффингæй хæстæг статьялтæ