Use http connection test for convenient hijacking

This commit is contained in:
cyp0633 2024-03-02 12:35:32 +08:00
parent c29972beb6
commit 35ebf5e9b5
2 changed files with 4 additions and 5 deletions

View File

@ -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

View File

@ -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 {