Total Pageviews

Sunday 25 September 2016

基于go的http代理服务器程序-gohttpproxy

cd /root/go/gospace/ (/root/go/gospace/ 为我的GOPATH)
go get -u -v github.com/tools/godep
go get -v ./...
git clone https://github.com/netroby/gohttpproxy
cd gohttpproxy
/root/go/gospace/bin/godep restore
/root/go/gospace/bin/godep go build
(在当前目录/root/go/gospace/gohttpproxy/下,会生成可执行文件gohttpproxy):

root@hb:~/go/gospace/gohttpproxy# ls
Dockerfile  Godeps  gohttpproxy  main.go  readme.md

root@hb:~/go/gospace/gohttpproxy# ./gohttpproxy -addr :7070 > /dev/null &
root@hb:~/go/gospace/gohttpproxy# disown -h
这样,http代理服务器your_vps_ip:7070就建立成功了。

from https://github.com/netroby/gohttpproxy