Use open-uri's dedicated Basic proxy option for the intermediary account:

require 'open-uri'

body = URI.open(
  'https://example.com/',
  proxy_http_basic_authentication: [
    'http://203.0.113.10:8080',
    ENV.fetch('PROXY_USER'),
    ENV.fetch('PROXY_PASSWORD')
  ],
  open_timeout: 5,
  read_timeout: 10
) { |response| response.read }

Replace the documentation endpoint and obtain account values from the intended secret source. Avoid putting the password into a URL that an exception or support report may later print.

OpenRead optionUse
proxy_http_basic_authenticationProxy address and its Basic username/password.
proxyProxy selection without that combined authenticated option; supplying both raises an argument error.
http_basic_authenticationDestination-server account.
proxy: nilMake this read direct despite environment defaults.

Without an explicit proxy option, open-uri can use scheme-specific proxy environment variables. The authenticated option already includes its endpoint; it needs no second proxy value.

This interface handles Basic proxy authentication. A service requiring another mechanism needs a compatible client or approved integration. Keep HTTPS verification enabled, then inspect status/content as appropriate: a working proxy login does not establish that the destination returned the expected resource.

ХӀокхунах тера йаззамаш