嗷嗷牛人大佬:
用sniproxy做的
这是一个TCP4层转发工具
https://github.com/dlundquist/sniproxy
一、安装sniproxy
- apt-get install -y git autotools-dev cdbs debhelper dh-autoreconf dpkg-dev gettext libev-dev libpcre3-dev libudns-dev pkg-config fakeroot devscripts
- git clone https://github.com/dlundquist/sniproxy.git
- cd sniproxy
- ./autogen.sh && dpkg-buildpackage
- dpkg -i ../sniproxy_*_*.deb
- apt-get install -y sniproxy
- yum install -y git autoconf automake curl gettext-devel libev-devel pcre-devel perl pkgconfig rpm-build udns-devel
- git clone https://github.com/dlundquist/sniproxy.git
- cd sniproxy
- ./autogen.sh && ./configure && make dist
- rpmbuild –define "_sourcedir `pwd`" -ba redhat/sniproxy.spec
- yum install ../sniproxy-*.*.rpm
- yum install -y sniproxy
二、修改sniproxy配置
找到开头就是table https_hosts {这一行
修改成下面这样子
- # named tables are defined with the table directive
- table https_hosts {
- # When proxying to local sockets you should use different tables since the
- # local socket server most likely will not autodetect which protocol is
- # being used
- example.org unix:/var/run/server.sock
- (.*.|)github.com$ *
- (.*.|)githubusercontent.com$ *
- }
三、启动sniproxy
- sniproxy -c /etc/sniproxy.conf
关闭:pkill sniproxy
四、在客户端设置hosts
修改/etc/hosts
如果原本有github的hosts配置了,就删除或者注释掉
添加下面的这些,把1.1.1.1改为你启动了sniproxy的VPS的IP
- 1.1.1.1 gist.github.com
- 1.1.1.1 github.com
- 1.1.1.1 www.github.com
- 1.1.1.1 avatars0.githubusercontent.com
- 1.1.1.1 avatars1.githubusercontent.com
- 1.1.1.1 avatars2.githubusercontent.com
- 1.1.1.1 avatars3.githubusercontent.com
- 1.1.1.1 avatars4.githubusercontent.com
- 1.1.1.1 avatars5.githubusercontent.com
- 1.1.1.1 avatars6.githubusercontent.com
- 1.1.1.1 avatars7.githubusercontent.com
- 1.1.1.1 avatars8.githubusercontent.com
- 1.1.1.1 camo.githubusercontent.com
- 1.1.1.1 cloud.githubusercontent.com
- 1.1.1.1 gist.githubusercontent.com
- 1.1.1.1 marketplace-screenshots.githubusercontent.com
- 1.1.1.1 raw.githubusercontent.com
- 1.1.1.1 repository-images.githubusercontent.com
- 1.1.1.1 user-images.githubusercontent.com
其他
IP add one:https://haoduck.com/713.html
如我上帖子所说:https://www.mjjcpu.com/thread-790321-1-1.html
我还是更想用nginx来反代,等什么时候闲了,我再试试看自签SSL证书来反代,看看行不行。
嗷嗷牛人大佬:
2收藏0回复惨案

zxxx牛人大佬:
收藏备用。