Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add no proxy #731

Merged
merged 4 commits into from
Aug 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions main.go
Expand Up @@ -281,6 +281,17 @@ func runCLIApp(c *cli.Context) (err error) {
"Added environment http_proxy: %s\n",
p)
}
// Pass through the no_proxy enviroment variable. Whenever
// using the http(s)_proxy environment variables. This should
// also be included to know for which hosts the use of proxies
// should be ignored.
if p, ok := os.LookupEnv("no_proxy"); ok {
env = append(env, fmt.Sprintf("no_proxy=%s", p))
fmt.Fprintf(
os.Stdout,
"Added environment no_proxy: %s\n",
p)
}

// Run.
err = daemonize.Run(path, args, env, os.Stdout)
Expand Down
7 changes: 7 additions & 0 deletions tools/mount_gcsfuse/main.go
Expand Up @@ -258,6 +258,13 @@ func run(args []string) (err error) {
} else if p, ok := os.LookupEnv("http_proxy"); ok {
cmd.Env = append(cmd.Env, fmt.Sprintf("http_proxy=%s", p))
}
// Pass through the no_proxy enviroment variable. Whenever
// using the http(s)_proxy environment variables. This should
// also be included to know for which hosts the use of proxies
// should be ignored.
if p, ok := os.LookupEnv("no_proxy"); ok {
cmd.Env = append(cmd.Env, fmt.Sprintf("no_proxy=%s", p))
}

cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
Expand Down