linux polipo_如何在Linux上安装和配置Polipo缓存Web代理?

linux polipo

linux polipo

Polipo was the best HTTP proxy when it emerged. Since then web behavior has a lot changed and HTTPS became popular. HTTPS prevents intermediates to read traffic and cache them. Polipo is not maintained currently but useful for different cases.

Polipo出现时是最好的HTTP代理。 从那时起,网络行为发生了很大变化,HTTPS变得流行。 HTTPS阻止中介读取流量并对其进行缓存。 目前不维护Polipo,但对于不同情况有用。

为Ubuntu,Debian,Mint,Kali安装 (Install For Ubuntu, Debian, Mint, Kali)

We can install polipo for Ubuntu, Debian, Mint, Kali with the apt-get command like below.

我们可以使用如下所示的apt-get命令为Ubuntu,Debian,Mint,Kali安装polipo。

$ sudo apt-get install polipo
Install For Ubuntu, Debian, Mint, Kali
Install For Ubuntu, Debian, Mint, Kali
为Ubuntu,Debian,Mint,Kali安装

为Ubuntu,Debian,Mint,Kali安装(Install For Ubuntu, Debian, Mint, Kali)

We can also install polipo web cache proxy with the yum command like below.

我们还可以使用yum命令安装polipo Web缓存代理,如下所示。

$ yum install polipo

配置文件 (Configuration File)

Polipo configuration file is stored in the /etc/polipo/polipo . We will use this configuration file in order to change the configuration. We can set configuration like Proxy Address, Allowed Clients, Log etc.

Polipo配置文件存储在/etc/polipo/polipo 。 我们将使用此配置文件来更改配置。 我们可以设置代理地址,允许的客户端,日志等配置。

Configuration File
Configuration File
配置文件

列出配置选项(List Configuration Options)

There are a lot of configuration options supported by the polipo. We can list the options with the -v option to the polipo command like below. Interestingly this option requires root privileges which is provided by sudo in the following example.

polipo支持许多配置选项。 我们可以在polipo命令中使用-v选项列出这些选项,如下所示。 有趣的是,此选项需要sudo在以下示例中提供的root特权。

$ sudo polipo -v
List Configuration Options
List Configuration Options
列出配置选项

设置代理地址(Set Proxy Address)

By default, the proxy will listen for local proxy connections. We can enable polipo to listen given IP address for network-wide proxy connection. We will use proxyAddress configuration and provide a network interface IP address for this into /etc/polipo/polipo configuration file. Polipo will listen port TCP 8123 by default.

默认情况下,代理将侦听本地代理连接。 我们可以使polipo侦听给定IP地址以进行网络范围的代理连接。 我们将使用proxyAddress配置,并为此在/etc/polipo/polipo配置文件中提供一个网络接口IP地址。 默认情况下,Polipo将侦听TCP 8123端口。

proxyAddress = 192.168.122

设置允许的客户 (Set Allowed Clients)

We can allow or deny the client those can connect to our polipo proxy. We will use allowedClients option. We can provide the network address in a CIDR format or client range with a dash.

我们可以允许或拒绝那些可以连接到我们的polipo代理的客户。 我们将使用allowedClients选项。 我们可以提供CIDR格式的网络地址或带破折号的客户范围。

allowedClients=192.168.122.0/24

OR we can use asterisk * to specify the whole network address range

或者我们可以使用星号*指定整个网络地址范围

allowedClients=192.168.122.*

We can also use asterisk for network number part like below.

我们也可以对网络号部分使用星号,如下所示。

allowedClients=192.168.*.*

显示Polipo服务状态 (Display Polipo Service Status)

We can use systemctl command to list polipo service status like below.

我们可以使用systemctl命令列出polipo服务状态,如下所示。

$ sudo systemctl status polipo
Display Polipo Service Status
Display Polipo Service Status
显示Polipo服务状态

重新启动服务以重新加载配置(Restart Service to Reload Configuration)

After making some configuration change in the /etc/polipo/polipo we need to restart the polipo proxy service to make these changes effect. We will use systemctl command like below which will restart polipo and reload the configuration.

/etc/polipo/polipo进行一些配置更改后,我们需要重新启动polipo代理服务以使这些更改生效。 我们将使用如下所示的systemctl命令,它将重新启动polipo并重新加载配置。

$ sudo systemctl restart polipo

Apt命令的客户端配置示例 (Example Client Config For Apt Command)

There are a lot of applications which can use proxy to connect internet. Apt command can be used with a proxy configuration. We can configuration Apt with the following line to connect a proxy like polipo.

有很多可以使用代理连接互联网的应用程序。 Apt命令可以与代理配置一起使用。 我们可以在下面的行中配置Apt以连接类似于polipo的代理。

Acquire::http::Proxy "http://192.168.0.1:8123";

Firefox的客户端配置示例 (Example Client Config For Firefox)

We can also configure Firefox browser in order to use polipo proxy server where port number is TCP 8123.  Open following configuration Edit->Preferences->Connection Settings->Maual Proxy Configuration

我们还可以配置Firefox浏览器以使用端口号为TCP 8123的polipo代理服务器。打开以下配置Edit -> Preferences -> Connection Settings -> Maual Proxy Configuration

Firefox Proxy Configuration
Firefox Proxy Configuration
Firefox代理配置
LEARN MORE  HTTP Status 503 Error Code and How To Fix It?
了解更多HTTP状态503错误代码以及如何解决?

翻译自: https://www.poftut.com/how-to-install-and-config-polipo-caching-web-proxy-on-linux/

linux polipo

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值