Page 1 of 1

Re: Customer unable to access Internet using commands

Posted: Thu Oct 22, 2020 11:54 am
by aashish97
Let's First Understand the Setup that the Client have:
The Client uses SafeSquid-SWG as the only medium to access the internet. which means that the user cannot access internet if he has not set Proxy Setting in his Internet Browser (can be anything Chrome. Firefox, Brave etc)
As per their Firewall Rule No IP can access internet other than SafeSquid IP, Which also means that even the ping from a client machine to a Internet Service will not work.
This is kind of Stringent Network Setup that the Client has.

For Applications like Browser They Support HTTP Proxy and do provide a Option to Set the Proxy Details.
Some Application does not have such Options in them, they either use the System Wide Proxy or Support the Proxy Setting provided in Environment Variables.

Same ways if we want to use git command we need to explicitly add/specify http_proxy and https_proxy Environment Variables .
Git and Apt-Get Command honours Proxy Environment variable and can use the Proxy to connect to internet

Same ways we added the Proxy Environment Variables in the client machine which uses Linux OS. and it solved their problem.

To Set Proxy Environment Variables on Linux OS:

If Proxy Does not Require Authentication:

Syntax

HTTP Proxy:

Code: Select all

export http_proxy=http://proxy-server-ip:proxy-server-port/
HTTPS PROXY

Code: Select all

export https_proxy=http://proxy-server-ip:proxy-server-port/

Example:

HTTP Proxy:

Code: Select all

export http_proxy=http://10.0.1.3:8080/
HTTPS PROXY

Code: Select all

export https_proxy=http://10.0.1.3:8080/

If Proxy Requires Authentication Then:

Syntax

HTTP Proxy:

Code: Select all

export http_proxy=http://username:password@proxy-server-ip:proxy-server-port/
HTTPS PROXY

Code: Select all

export https_proxy=http://username:password@proxy-server-ip:proxy-server-port/
Example:

HTTP Proxy:

Code: Select all

export http_proxy=http://foo:Bar@10.0.1.3:8080/
HTTPS PROXY

Code: Select all

export https_proxy=http://foo:Bar@10.0.1.3:8080/

Note: if password or username contains @ use below

Username: foo
Password: B@r

Code: Select all

export http_proxy=http://foo:B%40r@10.0.1.3:8080/

Code: Select all

export https_proxy=http://foo:B%40r@10.0.1.3:8080/





Note: There are applications that just does not support proxy and which not work in such a Stringent Network Setup.