mirror of https://github.com/cyp0633/drcom-go.git
Use http connection test for convenient hijacking
This commit is contained in:
parent
c29972beb6
commit
35ebf5e9b5
|
@ -90,9 +90,12 @@ func ParseConf() {
|
|||
// 扩展配置
|
||||
ext := cfg.Section("extend")
|
||||
if temp = ext.Key("connection_test_server").String(); temp != "" {
|
||||
if temp[:5] == "https" {
|
||||
temp = "http" + temp[5:]
|
||||
}
|
||||
ExtConf.ConnectionTestServer = temp
|
||||
} else {
|
||||
ExtConf.ConnectionTestServer = "https://connect.rom.miui.com/generate_204"
|
||||
ExtConf.ConnectionTestServer = "http://connect.rom.miui.com/generate_204"
|
||||
}
|
||||
if temp = ext.Key("dns_server").String(); temp != "" {
|
||||
ExtConf.DnsServer = temp
|
||||
|
|
|
@ -12,10 +12,6 @@ import (
|
|||
// 查找登录服务器地址
|
||||
func getServer() (server string) {
|
||||
generate_204 := util.ExtConf.ConnectionTestServer
|
||||
// 将 HTTPS 改为 HTTP
|
||||
if generate_204[:5] == "https" {
|
||||
generate_204 = "http" + generate_204[5:]
|
||||
}
|
||||
// 发 GET,检查是否有登录信息
|
||||
response, err := http.Get(generate_204)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue