嗷嗷牛人大佬:

用sniproxy做的

这是一个TCP4层转发工具

https://github.com/dlundquist/sniproxy

一、安装sniproxy

  1. apt-get install -y git autotools-dev cdbs debhelper dh-autoreconf dpkg-dev gettext libev-dev libpcre3-dev libudns-dev pkg-config fakeroot devscripts
  2. git clone https://github.com/dlundquist/sniproxy.git
  3. cd sniproxy
  4. ./autogen.sh && dpkg-buildpackage
  5. dpkg -i ../sniproxy_*_*.deb
  6. apt-get install -y sniproxy

  1. yum install -y git autoconf automake curl gettext-devel libev-devel pcre-devel perl pkgconfig rpm-build udns-devel
  2. git clone https://github.com/dlundquist/sniproxy.git
  3. cd sniproxy
  4. ./autogen.sh && ./configure && make dist
  5. rpmbuild –define "_sourcedir `pwd`" -ba redhat/sniproxy.spec
  6. yum install ../sniproxy-*.*.rpm
  7. yum install -y sniproxy

二、修改sniproxy配置

找到开头就是table https_hosts {这一行

修改成下面这样子

  1. # named tables are defined with the table directive
  2. table https_hosts {
  3.     # When proxying to local sockets you should use different tables since the
  4.     # local socket server most likely will not autodetect which protocol is
  5.     # being used
  6.     example.org unix:/var/run/server.sock
  7.     (.*.|)github.com$ *
  8.     (.*.|)githubusercontent.com$ *
  9. }

三、启动sniproxy

  1. sniproxy -c /etc/sniproxy.conf

关闭:pkill sniproxy

四、在客户端设置hosts

修改/etc/hosts

如果原本有github的hosts配置了,就删除或者注释掉
添加下面的这些,把1.1.1.1改为你启动了sniproxy的VPS的IP

  1. 1.1.1.1 gist.github.com
  2. 1.1.1.1 github.com
  3. 1.1.1.1 www.github.com
  4. 1.1.1.1 avatars0.githubusercontent.com
  5. 1.1.1.1 avatars1.githubusercontent.com
  6. 1.1.1.1 avatars2.githubusercontent.com
  7. 1.1.1.1 avatars3.githubusercontent.com
  8. 1.1.1.1 avatars4.githubusercontent.com
  9. 1.1.1.1 avatars5.githubusercontent.com
  10. 1.1.1.1 avatars6.githubusercontent.com
  11. 1.1.1.1 avatars7.githubusercontent.com
  12. 1.1.1.1 avatars8.githubusercontent.com
  13. 1.1.1.1 camo.githubusercontent.com
  14. 1.1.1.1 cloud.githubusercontent.com
  15. 1.1.1.1 gist.githubusercontent.com
  16. 1.1.1.1 marketplace-screenshots.githubusercontent.com
  17. 1.1.1.1 raw.githubusercontent.com
  18. 1.1.1.1 repository-images.githubusercontent.com
  19. 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回复惨案

使用sniproxy反代Github-图1

zxxx牛人大佬:
收藏备用。