Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set http_proxy environment variable with domain user and pass in windows

I've read many posts about this topic but unfortunately haven't been able to resolve my issue. I've been trying to set http_proxy and https_proxy environment variables in windows using command prompt to be able to access my company's web proxy.

I'm using Windows 8.1 in which proxy settings are already set to

Address = proxy01.company.com

Port = 8080.

my system is inside company.com domain, so:

my domain username is company\B.amini

and my domain password is BA@123

It's worth mentioning that when I ping proxy01.company.com, command prompt shows: Pinging tmg01.company.com [192.168.39.21] and it gives request timeout.

Question:

Now, based on above information, my question is:

  1. What might be the reason of request timeout when pinging proxy address?

  2. Are proxy credentials the same as domain credentials?

  3. what is the correct way of setting http_proxy variable in command prompt?

I've tried many variations including:

Set http_proxy=http://company%5CB.amini:BA%[email protected]:8080
Set http_proxy=http://B.amini:BA%[email protected]:8080
Set http_proxy=company%5CB.amini:BA%[email protected]:8080
Set http_proxy=B.amini:BA%[email protected]:8080
Set http_proxy=proxy01.company.com:8080
Set http_proxy=http://192.168.39.21:8080

But in all cases, running a command such as Curl www.google.com -I gives the following error:

HTTP/1.1 407 Proxy Authentication Required ( Forefront TMG requires authorizatio n to fulfill the request. Access to the Web Proxy filter is denied. )

like image 849
Bahman_Aries Avatar asked Jan 03 '23 21:01

Bahman_Aries


1 Answers

The isssue is the @ in your password, you should set like this:

setx http_proxy http://user:password@proxyIP:proxyPort/

Also its recomendable using setx for persistence

like image 168
Alejandro Mendoza Avatar answered Jan 06 '23 13:01

Alejandro Mendoza