set :default_env, fetch(:default_env, {}).merge(
  'http_proxy' => 'http://gateway.example:8080',
  'https_proxy' => 'http://gateway.example:8080'
)

In Capistrano 3 with SSHKit, this merges proxy values into the deployment host's command environment. Preserve other required values such as PATH instead of replacing the mapping.

The string keys retain lowercase spelling. SSHKit's command builder uppercases symbol keys, which can change behavior for clients requiring http_proxy. For example, curl treats the HTTP variable’s case specially.

For only selected operations, use an SSHKit with block carrying the same string-keyed values around the relevant execute calls.

These settings affect commands on the deployment host. They do not configure the laptop's SSH connection or persist an environment for a service later launched by another supervisor. Select a proxy reachable from that remote host; its localhost does not refer to a helper on the laptop. For a permitted public download with no proxy credentials retained by the remote tool, an HTTP entry from the HTTP proxy list can supply these remote environment values.

Ũhoro ũhĩtĩte