Linux之CentOS上部署安装goproxy服务端

摘要

技术永远不在一个人手上,感谢这些人对我们作出的伟大贡献。

#wget https://storage.googleapis.com/golang/go1.5.linux-amd64.tar.gz #如果速度不行用本站地址
wget http://www.dwhd.org/script/tar_gz_bz2/go1.5.linux-amd64.tar.gz
tar xf go1.5.linux-amd64.tar.gz -C /usr/local
echo "export GOROOT=/usr/local/go
export PATH=\$PATH:\$GOROOT/bin
export GOPATH=/home/go" >/etc/profile.d/go.sh
. /etc/profile.d/go.sh
go get github.com/shell909090/goproxy
cd /home/go/src/github.com/shell909090/goproxy
go get github.com/miekg/dns
go get github.com/op/go-logging
mkdir -p /usr/local/goproxy/{bin,config}
echo "export PATH=\$PATH:/usr/local/goproxy/bin" > /etc/profile.d/goproxy.sh
. /etc/profile.d/goproxy.sh
go build -o /usr/local/goproxy/bin/goproxy github.com/shell909090/goproxy/goproxy
chmod +x /usr/local/goproxy/bin/goproxy
yum install lrzsz -y
sz /usr/local/goproxy/bin/goproxy.exe /usr/local/goproxy/bin/goproxy_x64.exe \
/home/go/src/github.com/shell909090/goproxy/debian/routes.list.gz#下载客户端到本地

1080U2B 毫无压力
Linux之CentOS上部署安装goproxy服务端

本站已经编译好了各种版本

http://www.dwhd.org/goproxy/goproxy_linux_386
http://www.dwhd.org/goproxy/goproxy_linux_amd64
http://www.dwhd.org/goproxy/goproxy_windows_386.exe
http://www.dwhd.org/goproxy/goproxy_windows_amd64.exe
http://www.dwhd.org/goproxy/goproxy_darwin_386
http://www.dwhd.org/goproxy/goproxy_darwin_amd64
http://www.dwhd.org/goproxy/goproxy_freebsd_386
http://www.dwhd.org/goproxy/goproxy_freebsd_amd64
http://www.dwhd.org/goproxy/goproxy_arm
http://www.dwhd.org/goproxy/goproxy_arm64

各种平台交叉编译方法

GOOS=linux  GOARCH=386 go build -o bin/goproxy_linux_386 github.com/shell909090/goproxy/goproxy
GOOS=darwin  GOARCH=386 go build -o bin/goproxy_darwin_386 github.com/shell909090/goproxy/goproxy
GOOS=freebsd  GOARCH=386 go build -o bin/goproxy_freebsd_386 github.com/shell909090/goproxy/goproxy
GOOS=windows  GOARCH=386 go build -o bin/goproxy_windows_386.exe github.com/shell909090/goproxy/goproxy
GOOS=linux  GOARCH=amd64 go build -o bin/goproxy_linux_amd64 github.com/shell909090/goproxy/goproxy
GOOS=darwin  GOARCH=amd64 go build -o bin/goproxy_darwin_amd64 github.com/shell909090/goproxy/goproxy
GOOS=freebsd  GOARCH=amd64 go build -o bin/goproxy_freebsd_amd64 github.com/shell909090/goproxy/goproxy
GOOS=windows  GOARCH=amd64 go build -o bin/goproxy_windows_amd64.exe github.com/shell909090/goproxy/goproxy
GOOS=linux  GOARCH=arm go build -o bin/goproxy_arm github.com/shell909090/goproxy/goproxy
GOOS=linux  GOARCH=arm64 go build -o bin/goproxy_arm64 github.com/shell909090/goproxy/goproxy

真正的用法在下面~~

mkdir -p {/usr/local/goproxy/{bin,config},/tmp/goproxy}
cd /tmp/
echo "export PATH=\$PATH:/usr/local/goproxy/bin" > /etc/profile
source /etc/profile
if [ ! -x /usr/local/goproxy/bin/goproxy ]; then
	[ "$(getconf LONG_BIT)" = "64" ] && wget -4cq http://www.dwhd.org/goproxy/goproxy_linux_amd64 -O /usr/local/goproxy/bin/goproxy
	[ "$(getconf LONG_BIT)" = "32" ] && wget -4cq http://www.dwhd.org/goproxy/goproxy_linux_386 -O /usr/local/goproxy/bin/goproxy
	/usr/local/goproxy/bin/goproxy
fi

UserName=`date +%s%N | sha256sum | base64 | head -c 16`
PassWord=`date +%s%N | sha256sum | base64 | head -c 16`
Key=`head -c 16 /dev/random | base64`
IPaddress=`curl -4s curlip.me|awk '{print $2;exit}'`

cat >/usr/local/goproxy/config/config.json<< EOF
{
    "mode": "server",
    "listen": ":5233",

    "logfile": "",
    "loglevel": "WARNING",
    "adminiface": "127.0.0.1:5234",

    "cipher": "aes",
    "key": "$Key",

    "passwd": {
        "$UserName": "$PassWord"
    }
}
EOF

cat >/tmp/goproxy/config.json<< EOF
{
    "mode": "http",
    "listen": ":5233",
	"server": "$IPaddress:5233",

    "logfile": "./goproxy.log",
    "loglevel": "NOTICE",
    "adminiface": "127.0.0.1:5234",

    "dnsnet": "internal",

    "cipher": "aes",
    "key": "$Key",
    "blackfile": "./routes.list.gz",

    "username": "$UserName",
    "password": "$PassWord"
}
EOF
wget http://www.dwhd.org/goproxy/routes.list.gz -O /tmp/goproxy/routes.list.gz
wget http://www.dwhd.org/goproxy/RunHiddenConsole.exe -O /tmp/goproxy/RunHiddenConsole.exe
yum install tofrodos -y
echo '@echo off 
+>./goproxy.log
RunHiddenConsole ./goproxy.exe -config ./config.json' > /tmp/goproxy/GoProxy.bat
unix2dos -k /tmp/goproxy/GoProxy.bat
[ "$(getconf LONG_BIT)" = "32" ] && wget -4cq http://www.rarlab.com/rar/rarlinux-5.2.1.tar.gz
[ "$(getconf LONG_BIT)" = "64" ] && wget -4cq http://www.rarlab.com/rar/rarlinux-x64-5.2.1.tar.gz
tar xf rarlinux*.tar.gz && cd rar && make
rar a goproxy_client.rar goproxy
lookback
  • 本文由 发表于 2015年8月29日12:58:26
  • 除非特殊声明,本站文章均为原创,转载请务必保留本文链接
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

评论:13   其中:访客  13   博主  0
    • 凌云塔上 凌云塔上 2

      http://www.dwhd.org/goproxy/goproxy_windows_386.exe
      http://www.dwhd.org/goproxy/goproxy_windows_amd64.exe

      我把这两个下下来,但是点了什么也没出现…是不是我电脑少了什么鬼才导致打不开

      • xiaoyutou xiaoyutou 2

        这个需要windows客服端吗?

          • xiaoyutou xiaoyutou 2

            @ xiaoyutou 看明白了,这个既是客服端也是服务端。期待作者更新图形化windows客服端

              • lookback lookback

                @ xiaoyutou 不宜宣传,有点基础的应该能自己搞出来了,说的很详细了

            • wpaygp wpaygp 0

              对小白来说这个看不懂啊··有没有简单一些的教程····自己有VPS··

                • lookback lookback

                  @ wpaygp 不便传播,不想域名被墙。

                • 爱美爱魅 爱美爱魅 2

                  之前还在github上面问原作者centos下的安装WIKI呢。。可惜原作者讲的太深奥了。。。
                  你这篇文章很是及时啊。就是不知道,你在使用过程中这个软件和S*S对比的话,有什么优劣势呢。
                  golang和pyhton。。。

                    • lookback lookback

                      @ 爱美爱魅 这个就需要你自己测试了

                        • 爱美爱魅 爱美爱魅 2

                          @ lookback 给点建议,我会少折腾一下。之前尝试ngrok。已经装好golang。 :oops:

                            • lookback lookback

                              @ 爱美爱魅 单用户个人使用还不错,毕竟ss已经很成熟了

                                • 爱美爱魅 爱美爱魅 2

                                  @ lookback 谢谢建议。你的博客回复没有发邮件。。。要专门过来看一下。 :!: