使用squid快速搭建代理

简介:

如何使用squid快速搭建代理


=======

本项目主要介绍如何利用国外VPS搭建多协议代理服务。

GFW 封锁了 HTTP/Socks5 代理,HTTP 代理是关键词过滤,Socks5 代理则是封锁协议。不过某些特殊的低端口并没有这么处理,已知的有 21,25。

20端口已经被封杀,21端口目前会被限速400Kbps,换算后约合50KB/S,建议使用25端口,不限速。

搭建代理服务器

==============

在 25 端口搭建 http/https 代理。

Ubuntu:

1
2
3
apt-get  install  squid
curl https: //pac .itzmx.com /squid/ubuntu-squid .conf >>  /etc/squid3/squid .conf
/etc/init .d /squid  restart

Centos:

1
2
3
4
5
6
7
8
9
10
11
setenforce 0
ulimit  -n 1048576
echo  "* soft nofile 1048576"  >>  /etc/security/limits .conf
echo  "* hard nofile 1048576"  >>  /etc/security/limits .conf
killall sendmail
/etc/init .d /postfix  stop
chkconfig --level 2345 postfix off
yum -y  install  squid
wget -O  /etc/squid/squid .conf https: //pac .itzmx.com /squid/centos-squid .conf
/etc/init .d /squid  restart
chkconfig --level 2345 squid on


1
https: //pac .itzmx.com /squid/ubuntu-squid .conf的内容如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
auth_param basic program  /usr/lib/squid/basic_ncsa_auth  /etc/squid/passwd
auth_param basic children 5
auth_param basic realm Welcome to pac.itzmx.com proxy web server
acl SSL_ports port 443
acl Safe_ports port 80           # http
acl Safe_ports port 21           # ftp
acl Safe_ports port 443          # https
acl Safe_ports port 70           # gopher
acl Safe_ports port 210          # wais
acl Safe_ports port 1025-65535   # unregistered ports
acl Safe_ports port 280          # http-mgmt
acl Safe_ports port 488          # gss-http
acl Safe_ports port 591          # filemaker
acl Safe_ports port 777          # multiling http
acl CONNECT method CONNECT
acl squid_user proxy_auth REQUIRED
http_access allow squid_user
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny all
 
http_port 25
coredump_dir  /var/spool/squid
refresh_pattern -i ^ ftp :            525600    95% 525600 reload-into-ims
refresh_pattern -i ( /cgi-bin/ |\?)   0          0% 0      reload-into-ims
refresh_pattern -i .                525600    95% 525600 reload-into-ims
strip_query_terms off
visible_hostname pac.itzmx.com
cache_mgr 1265578519@qq.com
cache_store_log none
cache_access_log none
cache_mem 256 MB
cache_dir aufs  /var/cache/squid  5000 128 128
cache_swap_low 90
cache_swap_high 95
maximum_object_size 128 MB
maximum_object_size_in_memory 128 MB
dns_nameservers 8.8.8.8 8.8.4.4
client_lifetime 1 minutes
half_closed_clients off
fqdncache_size 65535
ipcache_size 65535
ipcache_low 90
ipcache_high 95


1
https: //pac .itzmx.com /squid/centos-squid .conf的内容如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
auth_param basic program  /usr/lib64/squid/ncsa_auth  /etc/squid/passwd
auth_param basic children 5
auth_param basic realm Welcome to pac.itzmx.com proxy web server
acl manager proto cache_object
 
acl localhost dst 127.0.0.0 /8  0.0.0.0 /32  ::1
acl SSL_ports port 443
acl Safe_ports port 80           # http
acl Safe_ports port 21           # ftp
acl Safe_ports port 443          # https
acl Safe_ports port 70           # gopher
acl Safe_ports port 210          # wais
acl Safe_ports port 1025-65535   # unregistered ports
acl Safe_ports port 280          # http-mgmt
acl Safe_ports port 488          # gss-http
acl Safe_ports port 591          # filemaker
acl Safe_ports port 777          # multiling http
acl CONNECT method CONNECT
acl squid_user proxy_auth REQUIRED
http_access allow squid_user
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny all
 
http_port 25
coredump_dir  /var/spool/squid
refresh_pattern -i ^ ftp :            525600    95% 525600 reload-into-ims
refresh_pattern -i ( /cgi-bin/ |\?)   0          0% 0      reload-into-ims
refresh_pattern -i .                525600    95% 525600 reload-into-ims
strip_query_terms off
visible_hostname pac.itzmx.com
cache_mgr 1265578519@qq.com
cache_store_log none
cache_access_log none
cache_mem 256 MB
cache_dir aufs  /var/cache/squid  5000 128 128
cache_swap_low 90
cache_swap_high 95
maximum_object_size 128 MB
maximum_object_size_in_memory 128 MB
dns_nameservers 8.8.8.8 8.8.4.4
client_lifetime 1 minutes
half_closed_clients off
fqdncache_size 65535
ipcache_size 65535
ipcache_low 90
ipcache_high 95


不知道能否使用,先收藏找时间试试



本文转自 f_066 51CTO博客,原文链接:http://blog.51cto.com/ganmu/1962417,如需转载请自行联系原作者

相关文章
|
Python Windows
怎么将 Python 项目打包成 exe?
这篇内容是一个关于使用Python和相关工具创建GUI应用并打包成Windows安装程序的教程摘要: - **环境**:Python 3.8,Tkinter(内置GUI库),PyInstaller 6.3.0,Inno Setup Compiler(用于创建安装包)。 - **基本流程**:在conda环境中创建一个独立的虚拟环境,编写一个使用Tkinter的GUI应用,添加图标,用PyInstaller将应用打包成单个可执行文件(exe),最后用Inno Setup Compiler将exe和相关文件打包成安装程序。
973 0
|
存储 监控 数据可视化
在Linux中,有哪些日志管理和分析工具?
在Linux中,有哪些日志管理和分析工具?
|
8月前
|
弹性计算
阿里云100M带宽收费标准:1年、1小时和一个月价格表,最新整理
阿里云100M固定带宽收费标准:以杭州地域为例,包月7725元,包年享8.5折价78795元,按量付费每小时24.063元。价格因地域而异,详情可查官方页面。
1342 6
|
Rust JavaScript 算法
【密码学】分析crypto-js当中AES的实现
之前杂(瞎)谈(聊)了很多, 本篇文章回归一下, 接着来看一看现代密码学, 那么为什么要看crypto-js当中的aes呢,这里先卖个关子吧, 具体读源码的时候再说, 这肯定不是因为我喜欢js语言, 我js实际上用的一点都不熟,都是现学现卖的。
1488 1
【密码学】分析crypto-js当中AES的实现
|
canal 消息中间件 关系型数据库
详解 canal 同步 MySQL 增量数据到 ES
canal 是阿里知名的开源项目,主要用途是基于 MySQL 数据库增量日志解析,提供增量数据订阅和消费。 这篇文章,我们手把手向同学们展示**使用 canal 将 MySQL 增量数据同步到 ES**
详解 canal 同步 MySQL 增量数据到 ES
|
11月前
|
自然语言处理 语音技术 开发工具
IndexTTS2.0_ 情感表达与时长可控的自回归零样本语音合成突破
IndexTTS2 是首个实现自回归模型下**时长可控**、**情感与音色解耦**的零样本语音合成系统。支持语音克隆、情感迁移与文本驱动情绪控制,适用于影视配音、虚拟主播等场景。开源代码与模型已发布,提供完整本地部署方案,大幅提升语音合成的实用性与表现力。
2939 5
|
弹性计算 运维 Shell
统计双色球各个数字的中奖概率
【4月更文挑战第29天】
1060 1
|
机器学习/深度学习 传感器 自然语言处理
【博士每天一篇文献-综述】A Systematic Review of Echo State Networks from Design to Application
本文系统回顾了回声状态网络(ESN)从设计到应用的全过程,探讨了其在多个领域的实际应用,并分析了不同结构的ESN模型如经典ESN、DeepESN和组合模型的性能,以及它们在时间序列预测和动态系统建模中的有效性。
515 1
【博士每天一篇文献-综述】A Systematic Review of Echo State Networks from Design to Application
|
NoSQL Java Redis
介绍Redis的各种用途以及使用场景
介绍Redis的各种用途以及使用场景 Redis 一、为什么使用 解决应用服务器的cpu和内存压力 减少io的读操作,减轻io的压力 关系型数据库的扩展性不强,难以改变表结构 二、优点: nosql数据库没有关联关系,数据结构简单,拓展表比较容易 nosql读取速度快,对较大数据.
12475 1