Preserve http_proxy environment variable when daemonizing
@@ -319,6 +319,12 @@ func runCLIApp(c *cli.Context) (err error) {
if p, ok := os.LookupEnv("GOOGLE_APPLICATION_CREDENTIALS"); ok {
env = append(env, fmt.Sprintf("GOOGLE_APPLICATION_CREDENTIALS=%s", p))
}
+ // Pass through the http_proxy environment variable, in case an isolated host
+ // requires a HTTP proxy server to reach the GCS endpoint.
+ if p, ok := os.LookupEnv("http_proxy"); ok {
+ env = append(env, fmt.Sprintf("http_proxy=%s", p))
+ }
+ }
// Run.
err = daemonize.Run(path, args, env, os.Stdout)
