Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gsnova0.26.4 如何部署到heroku 然后Android能用呢? #55

Open
0minghai opened this issue Sep 4, 2017 · 7 comments
Open

gsnova0.26.4 如何部署到heroku 然后Android能用呢? #55

0minghai opened this issue Sep 4, 2017 · 7 comments

Comments

@0minghai
Copy link

0minghai commented Sep 4, 2017

gsnova-paas-deploy-with-dependencies-v0.26.4.tar.bz2 里面哪些要改?
gsnova_android-v0.26.4.apk里面貌似都是默认的选项 貌似也没啥要改的。 T。T 好难啊~~

@yinqiwen
Copy link
Owner

yinqiwen commented Sep 5, 2017

部署包的问题,应该只需要修改key为自己的设置

android apk这个目前是需要和PC上的gsnova client配合使用的, PC上的gsnova 和android 上需要连接在一个路由器上:
gsnova client用来提供配置文件同步服务, 将需要同步的配置文件放到一个目录下,这个目录设置在cleint.json里的Admin/ConfigDir中。 文件目录则需要如下的目录结构:
android
├── cac
│   ├── client.json
│   └── hosts.json
├── heroku
│   ├── client.json
│   └── hosts.json
├── qcloud-kcp
│   ├── client.json
│   └── hosts.json
├── qcloud-quic
│   ├── client.json
│   └── hosts.json
└── qcloud-tcp
├── client.json
└── hosts.json

gsnova android 则同步这些配置后,就可以选择cac/heroku等配置了

@yinqiwen
Copy link
Owner

yinqiwen commented Sep 5, 2017

刚release了一个0.27.3,建议用这个, 与0.26.x不兼容

android的配置需要注意的是和pc上有微妙的不同,主要是udp/dns相关的地方,这个是一个例子:

{
	"Log": [
		"stdout"
	],
	"UserAgent": "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1",
	"Cipher": {
		"Method": "auto",
		"Key": "809240d3a021449f6e67bb73221d42df942a308a"
	},
	"Auth": "gsnova",
	"LocalDNS": {
		//"Listen": "127.0.0.1:48100",
		"FastDNS":["223.5.5.5","180.76.76.76"],
		"TrustedDNS": [
			"208.67.222.222:443",
			"208.67.220.220:443"
		],
		"TCPConnect": true
	},
	//fake address, only used as udp protocol indicator
	"UDPGW":{
		"Addr":"20.20.20.20:1111",
		"LocalDNSRecord":{
			"*" : "111.111.111.111"
		}
	},
	"SNI":{
		//Used to redirect SNI host to another for sniffed SNI
		"Redirect":{
			//This fix "DF-DFERH-01" error in HW phone for google play 
			"services.googleapis.cn":"services.googleapis.com"
		}
	},
	"Proxy":[
		{
			"Local": ":48100",
			"PAC":[
				{"Protocol":["dns"],"Remote":"direct"},
				{"Protocol":["udp"],"Remote":"direct"},
				{"Remote":"default"}
			]
		}
	],
	"Channel": [
		{
			"Enable": true,
			"Name": "default",
			"ServerList": [
				"quic://119.119.119.119:48100"
			],
			//if u are behind a HTTP proxy
			"HTTPProxy": "",
			"ConnsPerServer": 3,
			//Unit: second
			"DialTimeout": 5,
			//Unit: second
			"ReadTimeout": 15,
			//Reconnect after 120s
			"ReconnectPeriod": 2400,
			//ReconnectPeriod rand adjustment, the real reconnect period is random value between [P - adjust, P + adjust] 
			"RCPRandomAdjustment": 60,
			//Send heartbeat msg to keep alive 
			"HeartBeatPeriod": 30
		}
	]
}

@Kisesy
Copy link

Kisesy commented Sep 6, 2017

@yinqiwen 之前试了下 0.27.2,真是强,速度很快

今天部署了最新版的 paas,好像有些问题
20170906172557

如果使用前一个版本 0.27.2 版的服务端是可以的
研究了一会,最后发现需要把 Procfile 文件里最后的 * 加上双引号 -allow "*"
不然服务端里这个允许用户就会变成了 Godeps

2017-09-06T10:24:27.006642+00:00 app[web.1]:     "AllowedUser": [
2017-09-06T10:24:27.006643+00:00 app[web.1]:         "Godeps"
2017-09-06T10:24:27.006643+00:00 app[web.1]:     ],

加上引号就正常了,这个感觉很怪....

2017-09-06T10:32:02.602840+00:00 app[web.1]:     "AllowedUser": [
2017-09-06T10:32:02.602840+00:00 app[web.1]:         "*"
2017-09-06T10:32:02.602841+00:00 app[web.1]:     ],

@yinqiwen
Copy link
Owner

yinqiwen commented Sep 6, 2017

sorry, 忘了shell会解释 "*"

@Kisesy
Copy link

Kisesy commented Sep 6, 2017

感谢~

顺便问下如果想要 BlockedByGFW 并且是 http 的全部走 heroku
BlockedByGFW 并且是 https 的全部走 sni ,怎么设置,以前好像有个 "Method":["CONNECT"] 这种,但是新版应该不行吧
因为好像全部的网址都被这里写成 CONNECT 模式了

creq, _ := http.NewRequest("Connect", "https://"+host, nil)

顺便还有 apnic_cn.txt 不太正常,每次都会被写空
下次打开就无法加载了,需要改成只读模式才行

@yinqiwen
Copy link
Owner

yinqiwen commented Sep 6, 2017

试下
{"Protocol":["https"], "Rule":["BlockedByGFW"], "Remote":"Direct"}
这个是https的情况,在代理为http代理才能生效

@Kisesy
Copy link

Kisesy commented Sep 6, 2017

就是这样,确实可以,多谢,多谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants