XX-net / XX-Net

A proxy tool to bypass GFW.
33.08k stars 7.69k forks source link

Heroku搭建Goproxy简易教程 #2687

Open HappysurfBlocking opened 8 years ago

HappysurfBlocking commented 8 years ago

1.先注册Heroku账号,下载GoProxy https://git.io/goproxy 2.访问https://github.com/phuslu/fetchserver/tree/golang 3.点击Readme.md中的deploy to heroku 4.输入你想要的名称,服务器随意US或EU 5.在Goproxy目录下的php.json中的 "Url": "http://yourapp.com/" 修改为 "Url": "https://你的HEROKUapp名称.herokuapp.com/index.go" "SSLVerify": false改为"SSLVerify": true (false不稳定,易封杀) 6.运行goagent.exe,端口默认8087,如要修改main.json自己找

注:多个heroku程式可以改为如下 "fetchservers": [ { "url": "https://你的HEROKUapp名称1.herokuapp.com/index.go", "password": "123456", "sslverify": true }, { "url": "https://你的HEROKUapp名称2.herokuapp.com/index.go", "password": "123456", "sslverify": true }, //…… { "url": "https://你的HEROKUapp名称n.herokuapp.com/index.go", "password": "123456", "sslverify": true } //(这里没有逗号) ], "sites": [ "*" ], "transport": "direct" } 注意,推荐不宜过多,2-3个为宜,否则万一受到干扰得重新命名程序,工作量较大

注:第一、三步也可以deploy to openshift ,就是速度有点慢,愿意尝鲜的可以类比;

不要deploy to bluemix,bluemix延迟较低,不过需要手动上传fetchserver及Go Buildpark(自带的用不了),操作十分复杂,而且只能用一个月,一个月后要绑定信用卡

写了那么多,留下五个字:# 且用且珍惜

本人初中生一枚,水平有限,多多赐教

jzp820927 commented 8 years ago

PHP 估计也就能看看网页吧

HappysurfBlocking commented 8 years ago

很流畅,下载速度超过1m/s

jzp820927 commented 8 years ago

Heroku 也就适合移动网用户,电信用户也是慢成翔。

935352 commented 8 years ago

没搞定能不能帮一下,英语程度差不会设置 Heroku | Welcome to your new app! Refer to the documentation if you need help deploying.

jzp820927 commented 8 years ago

只要部署好了就行了,不用管提示

hcym commented 8 years ago

后生可畏

就按照楼主教程简单方便

非常感谢

HappysurfBlocking commented 8 years ago

@935352 不需要管他,这么做,好了就可以了

tcwilliy commented 8 years ago

Heroku 至今没有搞定怎么上传,上传那部分东西也不知道啊

tcwilliy commented 8 years ago

@HappysurfBlocking php 我部署上去了但是golang部署不上去,而且发的这个链接好像也失效了

tcwilliy commented 8 years ago

@HappysurfBlocking 大神能不能指点下golang这么部署的?

tcwilliy commented 8 years ago

@HappysurfBlocking 即使部署上去了也会出现Application Error An error occurred in the application and your page could not be served. Please try again in a few moments.

If you are the application owner, check your logs for details.

jzp820927 commented 8 years ago

出现这个是正常的,你试试能不能用就行了

tcwilliy commented 8 years ago

@jzp820927 用不了,youtube的时候报错Application Erro ,日志503

jzp820927 commented 8 years ago

这个应该很容易部署的啊,按着项目主页上的部署按钮,填几个信息,就完成了,一般不会有问题了 不晓得,你是在哪儿操作错误了,要不你删了,重新部署一次试试

tcwilliy commented 8 years ago

@jzp820927 、https://github.com/phuslu/fetchserver/tree/golang这个页面已经失效了,我在github上找到了一个可以用的,点击按钮一步步部署,结果还是Application Erro ,查看日志显示503,2016-04-08T14:10:31.940869+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/index.go" host=。。。。.herokuapp.com request_id=9ea81d06-af86-425c-a34b-23af085420b3 fwd="175.10.210.168" dyno= connect= service= status=503 bytes=

jzp820927 commented 8 years ago

url ,你是不是填的 https://你的HEROKUapp名称1.herokuapp.com/index.go ?

tcwilliy commented 8 years ago

@jzp820927 是啊

tcwilliy commented 8 years ago

@jzp820927 就是用的这个地址

tcwilliy commented 8 years ago

@jzp820927 这个是部署过程日志 -----> Go app detected -----> Checking Godeps/Godeps.json file. -----> Installing go1.6... done -----> Running: go install -v -tags heroku ./... github.com/phuslu/goproxy -----> Discovering process types Procfile declares types -> web -----> Compressing... Done: 2.2M -----> Launching... Released v3 https://myapp.herokuapp.com/ deployed to Heroku

jzp820927 commented 8 years ago

看着一起正常,没什么问题,你确定,还是不能用?

tcwilliy commented 8 years ago

@jzp820927 确定,我直接打开APP这个页面就会报错,填到goproxy的php.json中,打开youtube也是报应用错误

jzp820927 commented 8 years ago

就算正确部署了,打开这个页面也是报错的,不过是可以使用的。你检查下 php.json 配置文件,如果也没问题,我就不知道是什么问题了。

tcwilliy commented 8 years ago

@jzp820927 能否发一个配置了golang的php.json给我参考。不需要你的app

jzp820927 commented 8 years ago

就是楼主那个啊,我和他那个一模一样的

"Servers": [ { "Url": "http://yourapp.com/", "Password": "123456", "SSLVerify": false } ],

bychen009 commented 8 years ago

@jzp820927 以下这个地址部署失败呀:

https://github.com/phuslu/goproxy/tree/server.php-go

去这个地址重新部署,原来的项目移除了。

bychen009 commented 8 years ago

@jzp820927 heroku build app时出错:

-----> Go app detected !!
!! 'GOVERSION' isn't set, defaulting to 'go1.6' !!
!! Run 'heroku config:set GOVERSION=goX.Y' to set the Go version to use !! for future builds !!
-----> Installing go1.6.2... done -----> Installing glide v0.10.2... done !! Installing package '.' (default) !!
!! To install a different package spec for the next build run: !!
!! 'heroku config:set GO_INSTALL_PACKAGE_SPEC=""' !!
!! For more details see: https://devcenter.heroku.com/articles/go-dependencies-via-glide !!
-----> Fetching any unsaved dependencies (glide install) [INFO] Lock file (glide.lock) does not exist. Performing update. [INFO] Downloading dependencies. Please wait... [INFO] Fetching updates for github.com/klauspost/compress. [WARN] github.com/klauspost/compress appears to be a vendored package. Unable to update. Consider the '--update-vendored' flag. [INFO] Fetching updates for github.com/valyala/fasthttp. [WARN] github.com/valyala/fasthttp appears to be a vendored package. Unable to update. Consider the '--update-vendored' flag. [ERROR] Failed to set version on github.com/valyala/fasthttp to : exit status 128 [ERROR] Failed to set version on github.com/klauspost/compress to : exit status 128 [INFO] Resolving imports [INFO] Fetching updates for github.com/klauspost/cpuid. [WARN] github.com/klauspost/cpuid appears to be a vendored package. Unable to update. Consider the '--update-vendored' flag. [WARN] Unable to set verion on github.com/klauspost/cpuid to . Err: exit status 128 [INFO] Fetching updates for github.com/klauspost/crc32. [WARN] github.com/klauspost/crc32 appears to be a vendored package. Unable to update. Consider the '--update-vendored' flag. [WARN] Unable to set verion on github.com/klauspost/crc32 to . Err: exit status 128 [WARN] Unable to set verion on github.com/klauspost/compress to . Err: exit status 128 [INFO] Fetching updates for github.com/valyala/bytebufferpool. [WARN] github.com/valyala/bytebufferpool appears to be a vendored package. Unable to update. Consider the '--update-vendored' flag. [WARN] Unable to set verion on github.com/valyala/bytebufferpool to . Err: exit status 128 [WARN] Unable to set verion on github.com/valyala/fasthttp to . Err: exit status 128 [INFO] Downloading dependencies. Please wait... [INFO] Setting references for remaining imports [ERROR] Failed to set version on github.com/klauspost/cpuid to : exit status 128 [ERROR] Failed to set version on github.com/klauspost/crc32 to : exit status 128 [ERROR] Failed to set version on github.com/valyala/bytebufferpool to : exit status 128 [ERROR] Failed to set version on github.com/klauspost/compress to : exit status 128 [ERROR] Failed to set version on github.com/valyala/fasthttp to : exit status 128 [INFO] Project relies on 5 dependencies. An Error has occurred ! Push rejected, failed to compile Go app

jzp820927 commented 8 years ago

空了,我再试试吧,很久以前部署的,现在不知道什么情况了。

whhxmwhh commented 7 years ago

高手。我注册heluk就出现问题。。注册不过。说不是管理员