https://wiki.archlinux.org/api.php?action=feedcontributions&user=Narzac&feedformat=atomArchWiki - User contributions [en]2024-03-28T11:07:44ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Proxy_server&diff=175444Proxy server2011-12-21T15:50:15Z<p>Narzac: /* Environment variables */</p>
<hr />
<div>[[Category:Proxy servers (English)]]<br />
{{i18n|Proxy settings}}<br />
{{expansion}}<br />
==Introduction==<br />
A proxy is "an interface for a service, especially for one that is remote, resource-intensive, or otherwise difficult to use directly". Source: [http://en.wiktionary.org/wiki/proxy Proxy - Wiktionary].<br />
<br />
==Environment variables==<br />
Some programs (like [[wget]]) use environment variables of the form "protocol_proxy" to determine the proxy for a given protocol (e.g. HTTP, FTP, ...).<br />
<br />
Below is an example on how to set these variables in a shell:<br />
<br />
<nowiki><br />
export http_proxy=http://10.203.0.1:5187/<br />
export https_proxy=http://10.203.0.1:5187/<br />
export ftp_proxy=http://10.203.0.1:5187/<br />
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"</nowiki><br />
Some programs look for the all caps version of the environment variables.<br />
<br />
If the proxy environment variables are to be made available to all users and all applications, the above mentioned export commands may be added to a script, say "proxy.sh" inside /etc/profile.d/. The script has to be then made executable. This method is helpful while using a Desktop Environment like [[Xfce]] which does not provide an option for proxy configuration. For example, [[Chromium]] browser will make use of the variables set using this method while running XFCE. <br />
<br />
Alternatively you can automate the toggling of the variables by adding a function to your .bashrc (thanks to Alan Pope)<br />
<nowiki><br />
function proxy(){<br />
echo -n "username:"<br />
read -e username<br />
echo -n "password:"<br />
read -es password<br />
export http_proxy="http://$username:$password@proxyserver:8080/"<br />
export https_proxy="http://$username:$password@proxyserver:8080/"<br />
export ftp_proxy="http://$username:$password@proxyserver:8080/"<br />
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"<br />
echo -e "\nProxy environment variable set."<br />
}<br />
function proxyoff(){<br />
unset HTTP_PROXY<br />
unset http_proxy<br />
unset HTTPS_PROXY<br />
unset https_proxy<br />
unset FTP_PROXY<br />
unset ftp_proxy<br />
echo -e "\nProxy environment variable removed."<br />
} </nowiki><br />
<br />
If you do not need a password then omit it.<br />
<br />
As an alternative, you may want to use the following script. Add this script into your ".bashrc" and source the ".bashrc" file.<br />
Note that, It is recommended to put these kind of scripts in a separete file like "functions" then source this file instead of putting everything under ".bashrc".<br />
You just need to change the areas "YourUserName" and "ProxyServerAddress:Port" obviously.<br />
You may also want to change the name "myProxy" into sth. short and easy to write.<br />
<br />
<nowiki><br />
#!/bin/bash<br />
<br />
assignProxy(){<br />
PROXY_ENV="http_proxy ftp_proxy https_proxy all_proxy no_proxy HTTP_PROXY HTTPS_PROXY FTP_PROXY NO_PROXY ALL_PROXY"<br />
for envar in $PROXY_ENV<br />
do<br />
export $envar=$1<br />
done<br />
}<br />
<br />
clrProxy(){<br />
assignProxy "" # This is what 'unset' does.<br />
}<br />
<br />
myProxy(){<br />
user=YourUserName<br />
read -p "Password: " -s pass && echo -e " "<br />
proxy_value="http://$user:$pass@ProxyServerAddress:Port"<br />
assignProxy $proxy_value <br />
}<br />
</nowiki><br />
<br />
===Automation with network managers===<br />
*[[NetworkManager]] cannot change the environment variables.<br />
*[[netcfg]] could set-up these environment variables but they would not be seen by other applications as they are not child of netcfg.<br />
<br />
==About libproxy==<br />
[http://code.google.com/p/libproxy/ libproxy] (which is available in the extra repository) is an abstraction library which should be used by all applications that want to access a network resource. It still is in development but could lead to a unified and automated handling of proxies in GNU/Linux if widely adopted.<br />
<br />
The role of libproxy is to read the proxy settings form different sources and make them available to applications which use the library. The interesting part with libproxy is that it offers an implementation of the [http://en.wikipedia.org/wiki/Web_Proxy_Autodiscovery_Protocol Web Proxy Autodiscovery Protocol] and an implementation of [http://en.wikipedia.org/wiki/Proxy_auto-config Proxy Auto-Config] that goes with it.<br />
<br />
The {{Ic|/usr/bin/proxy}} binary takes URL(s) as argument(s) and returns the proxy/proxies that could be used to fetch this/these network resource(s).<br />
{{Note|the 0.2.3-1 version does not work for me.}}<br />
<br />
As of 06/04/2009 libproxy is required by libsoup. It is then indirectly used by the [http://www.archlinux.org/packages/extra/i686/midori/ Midori] browser.<br />
<br />
== Web Proxy Options ==<br />
* [[Squid]] is a very popular caching/optimizing proxy<br />
* [[Privoxy]] is an anonymizing and ad-blocking proxy<br />
* For a simple proxy, ssh with port forwarding can be used<br />
<br />
=== Simple Proxy with SSH ===<br />
Connect to a server (HOST) on which you have an account (USER) as follows<br />
ssh -D PORT USER@HOST<br />
For PORT, choose some number which is not an IANA registered port. This specifies that traffic on the local PORT will be forwarded to the remote HOST. ssh will act as a [[Wikipedia:SOCKS|SOCKS]] server. Software supporting SOCKS proxy servers can simply be configured to connect to PORT on localhost.<br />
<br />
==Using a SOCKS proxy==<br />
There are two cases:<br />
*the application you want to use handles SOCKS proxies (for example Firefox) then you just have to configure it to use the proxy<br />
*the application you want to use does not handle SOCKS proxies then you can try to use [http://tsocks.sourceforge.net/ tsocks] (available in extra)<br />
<br />
==Proxy settings on GNOME3==<br />
Some programs like [[Chromium]] prefer to use the settings stored by gnome. These settings can be modified through the gnome-control-center front end and also through gsettings.<br />
<br />
gsettings set org.gnome.system.proxy mode 'manual' <br />
gsettings set org.gnome.system.proxy.http host 'proxy.localdomain.com'<br />
gsettings set org.gnome.system.proxy.http port 8080<br />
gsettings set org.gnome.system.proxy.ftp host 'proxy.localdomain.com'<br />
gsettings set org.gnome.system.proxy.ftp port 8080<br />
gsettings set org.gnome.system.proxy.https host 'proxy.localdomain.com'<br />
gsettings set org.gnome.system.proxy.https port 8080<br />
gsettings set org.gnome.system.proxy ignore-hosts "['localhost', '127.0.0.0/8', '10.0.0.0/8', '192.168.0.0/16', '172.16.0.0/12' , '*.localdomain.com' ]"<br />
<br />
This configuration can also be set to automatically execute when [[NetworkManager#Proxy_settings|Network Manager]] connects to specific networks , by using the package {{Package AUR|proxydriver}} from the [[AUR]]</div>Narzachttps://wiki.archlinux.org/index.php?title=Proxy_server&diff=175307Proxy server2011-12-20T17:55:01Z<p>Narzac: /* Environment variables */</p>
<hr />
<div>[[Category:Proxy servers (English)]]<br />
{{i18n|Proxy settings}}<br />
{{expansion}}<br />
==Introduction==<br />
A proxy is "an interface for a service, especially for one that is remote, resource-intensive, or otherwise difficult to use directly". Source: [http://en.wiktionary.org/wiki/proxy Proxy - Wiktionary].<br />
<br />
==Environment variables==<br />
Some programs (like [[wget]]) use environment variables of the form "protocol_proxy" to determine the proxy for a given protocol (e.g. HTTP, FTP, ...).<br />
<br />
Below is an example on how to set these variables in a shell:<br />
<br />
<nowiki><br />
export http_proxy=http://10.203.0.1:5187/<br />
export https_proxy=http://10.203.0.1:5187/<br />
export ftp_proxy=http://10.203.0.1:5187/<br />
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"</nowiki><br />
Some programs look for the all caps version of the environment variables.<br />
<br />
If the proxy environment variables are to be made available to all users and all applications, the above mentioned export commands may be added to a script, say "proxy.sh" inside /etc/profile.d/. The script has to be then made executable. This method is helpful while using a Desktop Environment like [[Xfce]] which does not provide an option for proxy configuration. For example, [[Chromium]] browser will make use of the variables set using this method while running XFCE. <br />
<br />
Alternatively you can automate the toggling of the variables by adding a function to your .bashrc (thanks to Alan Pope)<br />
<nowiki><br />
function proxy(){<br />
echo -n "username:"<br />
read -e username<br />
echo -n "password:"<br />
read -es password<br />
export http_proxy="http://$username:$password@proxyserver:8080/"<br />
export https_proxy="http://$username:$password@proxyserver:8080/"<br />
export ftp_proxy="http://$username:$password@proxyserver:8080/"<br />
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"<br />
echo -e "\nProxy environment variable set."<br />
}<br />
function proxyoff(){<br />
unset HTTP_PROXY<br />
unset http_proxy<br />
unset HTTPS_PROXY<br />
unset https_proxy<br />
unset FTP_PROXY<br />
unset ftp_proxy<br />
echo -e "\nProxy environment variable removed."<br />
} </nowiki><br />
<br />
If you do not need a password then omit it.<br />
<br />
Alternatively, you may want to use the following script. Add this script into your ".bashrc" and source the ".bashrc" file.<br />
Note that, It is recommended to put these kind of scripts in a separete file like "functions" then source this file instead of putting everything under ".bashrc".<br />
You just need to change the areas "YourUserName" and "ProxyServerAddress:Port" obviously.<br />
You may also want to change the name "myProxy" into sth. short and easy to write.<br />
<br />
<nowiki><br />
#!/bin/bash<br />
<br />
assignProxy(){<br />
PROXY_ENV="http_proxy ftp_proxy https_proxy all_proxy no_proxy HTTP_PROXY HTTPS_PROXY FTP_PROXY NO_PROXY ALL_PROXY"<br />
for envar in $PROXY_ENV<br />
do<br />
export $envar=$1<br />
done<br />
}<br />
<br />
clrProxy(){<br />
assignProxy "" # This is what 'unset' does.<br />
}<br />
<br />
myProxy(){<br />
clrProxy<br />
user=YourUserName<br />
read -p "Password: " -s pass && echo -e " "<br />
proxy_value="http://$user:$pass@ProxyServerAddress:Port"<br />
assignProxy $proxy_value <br />
}<br />
</nowiki><br />
<br />
===Automation with network managers===<br />
*[[NetworkManager]] cannot change the environment variables.<br />
*[[netcfg]] could set-up these environment variables but they would not be seen by other applications as they are not child of netcfg.<br />
<br />
==About libproxy==<br />
[http://code.google.com/p/libproxy/ libproxy] (which is available in the extra repository) is an abstraction library which should be used by all applications that want to access a network resource. It still is in development but could lead to a unified and automated handling of proxies in GNU/Linux if widely adopted.<br />
<br />
The role of libproxy is to read the proxy settings form different sources and make them available to applications which use the library. The interesting part with libproxy is that it offers an implementation of the [http://en.wikipedia.org/wiki/Web_Proxy_Autodiscovery_Protocol Web Proxy Autodiscovery Protocol] and an implementation of [http://en.wikipedia.org/wiki/Proxy_auto-config Proxy Auto-Config] that goes with it.<br />
<br />
The {{Ic|/usr/bin/proxy}} binary takes URL(s) as argument(s) and returns the proxy/proxies that could be used to fetch this/these network resource(s).<br />
{{Note|the 0.2.3-1 version does not work for me.}}<br />
<br />
As of 06/04/2009 libproxy is required by libsoup. It is then indirectly used by the [http://www.archlinux.org/packages/extra/i686/midori/ Midori] browser.<br />
<br />
== Web Proxy Options ==<br />
* [[Squid]] is a very popular caching/optimizing proxy<br />
* [[Privoxy]] is an anonymizing and ad-blocking proxy<br />
* For a simple proxy, ssh with port forwarding can be used<br />
<br />
=== Simple Proxy with SSH ===<br />
Connect to a server (HOST) on which you have an account (USER) as follows<br />
ssh -D PORT USER@HOST<br />
For PORT, choose some number which is not an IANA registered port. This specifies that traffic on the local PORT will be forwarded to the remote HOST. ssh will act as a [[Wikipedia:SOCKS|SOCKS]] server. Software supporting SOCKS proxy servers can simply be configured to connect to PORT on localhost.<br />
<br />
==Using a SOCKS proxy==<br />
There are two cases:<br />
*the application you want to use handles SOCKS proxies (for example Firefox) then you just have to configure it to use the proxy<br />
*the application you want to use does not handle SOCKS proxies then you can try to use [http://tsocks.sourceforge.net/ tsocks] (available in extra)<br />
<br />
==Proxy settings on GNOME3==<br />
Some programs like [[Chromium]] prefer to use the settings stored by gnome. These settings can be modified through the gnome-control-center front end and also through gsettings.<br />
<br />
gsettings set org.gnome.system.proxy mode 'manual' <br />
gsettings set org.gnome.system.proxy.http host 'proxy.localdomain.com'<br />
gsettings set org.gnome.system.proxy.http port 8080<br />
gsettings set org.gnome.system.proxy.ftp host 'proxy.localdomain.com'<br />
gsettings set org.gnome.system.proxy.ftp port 8080<br />
gsettings set org.gnome.system.proxy.https host 'proxy.localdomain.com'<br />
gsettings set org.gnome.system.proxy.https port 8080<br />
gsettings set org.gnome.system.proxy ignore-hosts "['localhost', '127.0.0.0/8', '10.0.0.0/8', '192.168.0.0/16', '172.16.0.0/12' , '*.localdomain.com' ]"<br />
<br />
This configuration can also be set to automatically execute when [[NetworkManager#Proxy_settings|Network Manager]] connects to specific networks , by using the package {{Package AUR|proxydriver}} from the [[AUR]]</div>Narzachttps://wiki.archlinux.org/index.php?title=Proxy_server&diff=175306Proxy server2011-12-20T17:53:37Z<p>Narzac: /* Environment variables */</p>
<hr />
<div>[[Category:Proxy servers (English)]]<br />
{{i18n|Proxy settings}}<br />
{{expansion}}<br />
==Introduction==<br />
A proxy is "an interface for a service, especially for one that is remote, resource-intensive, or otherwise difficult to use directly". Source: [http://en.wiktionary.org/wiki/proxy Proxy - Wiktionary].<br />
<br />
==Environment variables==<br />
Some programs (like [[wget]]) use environment variables of the form "protocol_proxy" to determine the proxy for a given protocol (e.g. HTTP, FTP, ...).<br />
<br />
Below is an example on how to set these variables in a shell:<br />
<br />
<nowiki><br />
export http_proxy=http://10.203.0.1:5187/<br />
export https_proxy=http://10.203.0.1:5187/<br />
export ftp_proxy=http://10.203.0.1:5187/<br />
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"</nowiki><br />
Some programs look for the all caps version of the environment variables.<br />
<br />
If the proxy environment variables are to be made available to all users and all applications, the above mentioned export commands may be added to a script, say "proxy.sh" inside /etc/profile.d/. The script has to be then made executable. This method is helpful while using a Desktop Environment like [[Xfce]] which does not provide an option for proxy configuration. For example, [[Chromium]] browser will make use of the variables set using this method while running XFCE. <br />
<br />
Alternatively you can automate the toggling of the variables by adding a function to your .bashrc (thanks to Alan Pope)<br />
<nowiki><br />
function proxy(){<br />
echo -n "username:"<br />
read -e username<br />
echo -n "password:"<br />
read -es password<br />
export http_proxy="http://$username:$password@proxyserver:8080/"<br />
export https_proxy="http://$username:$password@proxyserver:8080/"<br />
export ftp_proxy="http://$username:$password@proxyserver:8080/"<br />
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"<br />
echo -e "\nProxy environment variable set."<br />
}<br />
function proxyoff(){<br />
unset HTTP_PROXY<br />
unset http_proxy<br />
unset HTTPS_PROXY<br />
unset https_proxy<br />
unset FTP_PROXY<br />
unset ftp_proxy<br />
echo -e "\nProxy environment variable removed."<br />
} </nowiki><br />
<br />
If you do not need a password then omit it.<br />
<br />
Alternatively, you may want to use the following script. Add this script into your ".bashrc" and source the ".bashrc" file.<br />
It is recommended to put these kind of scripts in a separete file like "functions" then source this file instead of putting everything under ".bashrc".<br />
You just need to change the areas "YourUserName" and "ProxyServerAddress:Port" obviously.<br />
You may also want to change the name "myProxy" into sth. short and easy to write.<br />
<br />
<nowiki><br />
#!/bin/bash<br />
<br />
assignProxy(){<br />
PROXY_ENV="http_proxy ftp_proxy https_proxy all_proxy no_proxy HTTP_PROXY HTTPS_PROXY FTP_PROXY NO_PROXY ALL_PROXY"<br />
for envar in $PROXY_ENV<br />
do<br />
export $envar=$1<br />
done<br />
}<br />
<br />
clrProxy(){<br />
assignProxy "" # This is what 'unset' does.<br />
}<br />
<br />
myProxy(){<br />
clrProxy<br />
user=YourUserName<br />
read -p "Password: " -s pass && echo -e " "<br />
proxy_value="http://$user:$pass@ProxyServerAddress:Port"<br />
assignProxy $proxy_value <br />
}<br />
</nowiki><br />
<br />
===Automation with network managers===<br />
*[[NetworkManager]] cannot change the environment variables.<br />
*[[netcfg]] could set-up these environment variables but they would not be seen by other applications as they are not child of netcfg.<br />
<br />
==About libproxy==<br />
[http://code.google.com/p/libproxy/ libproxy] (which is available in the extra repository) is an abstraction library which should be used by all applications that want to access a network resource. It still is in development but could lead to a unified and automated handling of proxies in GNU/Linux if widely adopted.<br />
<br />
The role of libproxy is to read the proxy settings form different sources and make them available to applications which use the library. The interesting part with libproxy is that it offers an implementation of the [http://en.wikipedia.org/wiki/Web_Proxy_Autodiscovery_Protocol Web Proxy Autodiscovery Protocol] and an implementation of [http://en.wikipedia.org/wiki/Proxy_auto-config Proxy Auto-Config] that goes with it.<br />
<br />
The {{Ic|/usr/bin/proxy}} binary takes URL(s) as argument(s) and returns the proxy/proxies that could be used to fetch this/these network resource(s).<br />
{{Note|the 0.2.3-1 version does not work for me.}}<br />
<br />
As of 06/04/2009 libproxy is required by libsoup. It is then indirectly used by the [http://www.archlinux.org/packages/extra/i686/midori/ Midori] browser.<br />
<br />
== Web Proxy Options ==<br />
* [[Squid]] is a very popular caching/optimizing proxy<br />
* [[Privoxy]] is an anonymizing and ad-blocking proxy<br />
* For a simple proxy, ssh with port forwarding can be used<br />
<br />
=== Simple Proxy with SSH ===<br />
Connect to a server (HOST) on which you have an account (USER) as follows<br />
ssh -D PORT USER@HOST<br />
For PORT, choose some number which is not an IANA registered port. This specifies that traffic on the local PORT will be forwarded to the remote HOST. ssh will act as a [[Wikipedia:SOCKS|SOCKS]] server. Software supporting SOCKS proxy servers can simply be configured to connect to PORT on localhost.<br />
<br />
==Using a SOCKS proxy==<br />
There are two cases:<br />
*the application you want to use handles SOCKS proxies (for example Firefox) then you just have to configure it to use the proxy<br />
*the application you want to use does not handle SOCKS proxies then you can try to use [http://tsocks.sourceforge.net/ tsocks] (available in extra)<br />
<br />
==Proxy settings on GNOME3==<br />
Some programs like [[Chromium]] prefer to use the settings stored by gnome. These settings can be modified through the gnome-control-center front end and also through gsettings.<br />
<br />
gsettings set org.gnome.system.proxy mode 'manual' <br />
gsettings set org.gnome.system.proxy.http host 'proxy.localdomain.com'<br />
gsettings set org.gnome.system.proxy.http port 8080<br />
gsettings set org.gnome.system.proxy.ftp host 'proxy.localdomain.com'<br />
gsettings set org.gnome.system.proxy.ftp port 8080<br />
gsettings set org.gnome.system.proxy.https host 'proxy.localdomain.com'<br />
gsettings set org.gnome.system.proxy.https port 8080<br />
gsettings set org.gnome.system.proxy ignore-hosts "['localhost', '127.0.0.0/8', '10.0.0.0/8', '192.168.0.0/16', '172.16.0.0/12' , '*.localdomain.com' ]"<br />
<br />
This configuration can also be set to automatically execute when [[NetworkManager#Proxy_settings|Network Manager]] connects to specific networks , by using the package {{Package AUR|proxydriver}} from the [[AUR]]</div>Narzachttps://wiki.archlinux.org/index.php?title=Proxy_server&diff=175305Proxy server2011-12-20T17:34:59Z<p>Narzac: /* Environment variables */</p>
<hr />
<div>[[Category:Proxy servers (English)]]<br />
{{i18n|Proxy settings}}<br />
{{expansion}}<br />
==Introduction==<br />
A proxy is "an interface for a service, especially for one that is remote, resource-intensive, or otherwise difficult to use directly". Source: [http://en.wiktionary.org/wiki/proxy Proxy - Wiktionary].<br />
<br />
==Environment variables==<br />
Some programs (like [[wget]]) use environment variables of the form "protocol_proxy" to determine the proxy for a given protocol (e.g. HTTP, FTP, ...).<br />
<br />
Below is an example on how to set these variables in a shell:<br />
<br />
<nowiki><br />
export http_proxy=http://10.203.0.1:5187/<br />
export https_proxy=http://10.203.0.1:5187/<br />
export ftp_proxy=http://10.203.0.1:5187/<br />
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"</nowiki><br />
Some programs look for the all caps version of the environment variables.<br />
<br />
If the proxy environment variables are to be made available to all users and all applications, the above mentioned export commands may be added to a script, say "proxy.sh" inside /etc/profile.d/. The script has to be then made executable. This method is helpful while using a Desktop Environment like [[Xfce]] which does not provide an option for proxy configuration. For example, [[Chromium]] browser will make use of the variables set using this method while running XFCE. <br />
<br />
Alternatively you can automate the toggling of the variables by adding a function to your .bashrc (thanks to Alan Pope)<br />
<nowiki><br />
function proxy(){<br />
echo -n "username:"<br />
read -e username<br />
echo -n "password:"<br />
read -es password<br />
export http_proxy="http://$username:$password@proxyserver:8080/"<br />
export https_proxy="http://$username:$password@proxyserver:8080/"<br />
export ftp_proxy="http://$username:$password@proxyserver:8080/"<br />
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"<br />
echo -e "\nProxy environment variable set."<br />
}<br />
function proxyoff(){<br />
unset HTTP_PROXY<br />
unset http_proxy<br />
unset HTTPS_PROXY<br />
unset https_proxy<br />
unset FTP_PROXY<br />
unset ftp_proxy<br />
echo -e "\nProxy environment variable removed."<br />
}</nowiki><br />
If you do not need a password then omit it.<br />
<br />
Alternatively, you may want to use the following script. Just change the areas in bold to your taste and/or need.<br />
<nowiki><br />
---------------------------------------------------------<br />
#!/bin/bash<br />
<br />
assignProxy(){<br />
PROXY_ENV="http_proxy ftp_proxy https_proxy all_proxy no_proxy HTTP_PROXY HTTPS_PROXY FTP_PROXY NO_PROXY ALL_PROXY"<br />
for envar in $PROXY_ENV<br />
do<br />
export $envar=$1<br />
done<br />
}<br />
<br />
clrProxy(){<br />
assignProxy "" # This is what 'unset' does.<br />
}<br />
<br />
'''myProxy'''(){<br />
clrProxy<br />
user='''YourUserName'''<br />
read -p "Password: " -s pass && echo -e " "<br />
proxy_value="'''http://$user:$pass@ProxyServerAddress:Port'''"<br />
assignProxy $proxy_value <br />
} <br />
</nowiki><br />
<br />
===Automation with network managers===<br />
*[[NetworkManager]] cannot change the environment variables.<br />
*[[netcfg]] could set-up these environment variables but they would not be seen by other applications as they are not child of netcfg.<br />
<br />
==About libproxy==<br />
[http://code.google.com/p/libproxy/ libproxy] (which is available in the extra repository) is an abstraction library which should be used by all applications that want to access a network resource. It still is in development but could lead to a unified and automated handling of proxies in GNU/Linux if widely adopted.<br />
<br />
The role of libproxy is to read the proxy settings form different sources and make them available to applications which use the library. The interesting part with libproxy is that it offers an implementation of the [http://en.wikipedia.org/wiki/Web_Proxy_Autodiscovery_Protocol Web Proxy Autodiscovery Protocol] and an implementation of [http://en.wikipedia.org/wiki/Proxy_auto-config Proxy Auto-Config] that goes with it.<br />
<br />
The {{Ic|/usr/bin/proxy}} binary takes URL(s) as argument(s) and returns the proxy/proxies that could be used to fetch this/these network resource(s).<br />
{{Note|the 0.2.3-1 version does not work for me.}}<br />
<br />
As of 06/04/2009 libproxy is required by libsoup. It is then indirectly used by the [http://www.archlinux.org/packages/extra/i686/midori/ Midori] browser.<br />
<br />
== Web Proxy Options ==<br />
* [[Squid]] is a very popular caching/optimizing proxy<br />
* [[Privoxy]] is an anonymizing and ad-blocking proxy<br />
* For a simple proxy, ssh with port forwarding can be used<br />
<br />
=== Simple Proxy with SSH ===<br />
Connect to a server (HOST) on which you have an account (USER) as follows<br />
ssh -D PORT USER@HOST<br />
For PORT, choose some number which is not an IANA registered port. This specifies that traffic on the local PORT will be forwarded to the remote HOST. ssh will act as a [[Wikipedia:SOCKS|SOCKS]] server. Software supporting SOCKS proxy servers can simply be configured to connect to PORT on localhost.<br />
<br />
==Using a SOCKS proxy==<br />
There are two cases:<br />
*the application you want to use handles SOCKS proxies (for example Firefox) then you just have to configure it to use the proxy<br />
*the application you want to use does not handle SOCKS proxies then you can try to use [http://tsocks.sourceforge.net/ tsocks] (available in extra)<br />
<br />
==Proxy settings on GNOME3==<br />
Some programs like [[Chromium]] prefer to use the settings stored by gnome. These settings can be modified through the gnome-control-center front end and also through gsettings.<br />
<br />
gsettings set org.gnome.system.proxy mode 'manual' <br />
gsettings set org.gnome.system.proxy.http host 'proxy.localdomain.com'<br />
gsettings set org.gnome.system.proxy.http port 8080<br />
gsettings set org.gnome.system.proxy.ftp host 'proxy.localdomain.com'<br />
gsettings set org.gnome.system.proxy.ftp port 8080<br />
gsettings set org.gnome.system.proxy.https host 'proxy.localdomain.com'<br />
gsettings set org.gnome.system.proxy.https port 8080<br />
gsettings set org.gnome.system.proxy ignore-hosts "['localhost', '127.0.0.0/8', '10.0.0.0/8', '192.168.0.0/16', '172.16.0.0/12' , '*.localdomain.com' ]"<br />
<br />
This configuration can also be set to automatically execute when [[NetworkManager#Proxy_settings|Network Manager]] connects to specific networks , by using the package {{Package AUR|proxydriver}} from the [[AUR]]</div>Narzac