1

How to set a proxy for terminal without exporting the environment variable?

I am using a Ubuntu machine and I would like to do that?

If it not possible, are there any apps to help me do that?

Thank you.

1n4ho12
  • 13
  • 2
  • be more precise, you have two options, either using iptables or using a default configuration. it's missing what you want to afford – djdomi Sep 12 '22 at 17:09

1 Answers1

0

You can always set up the variable just for the command you want to run, for instance, you can do the following:

$ HTTPS_PROXY=http://localhost:3128 curl https://external.domain.com/

And curl will use the HTTPS_PROXY defined right there and only once.

If you want to set the environment variable, it will work for the whole Terminal Session, but not for any other user/system - it won't affect your cron jobs, for instance.

Marcel
  • 1,730
  • 10
  • 15