Skip to content

Commit

Permalink
Use http connection test for convenient hijacking
Browse files Browse the repository at this point in the history
  • Loading branch information
cyp0633 committed Mar 2, 2024
1 parent c29972b commit 35ebf5e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 4 additions & 1 deletion internal/util/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions internal/web/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 35ebf5e

Please sign in to comment.