Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Commit

Permalink
在有 BILI_WS_HOST_FORCE 的情況下才會更改 wsHost
Browse files Browse the repository at this point in the history
  • Loading branch information
eric2788 committed Apr 30, 2022
1 parent 1c4a493 commit 848475e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions services/blive/live_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ func LaunchLiveServer(
var wsHost = biligo.WsDefaultHost

// 如果有強制指定 ws host, 則使用
if os.Getenv("BILI_WS_HOST_FORCE") != "" {
if strings.HasPrefix(os.Getenv("BILI_WS_HOST_FORCE"), "wss://") {

wsHost = os.Getenv("BILI_WS_HOST_FORCE")

} else { // 否則從 api 獲取 host list 並提取低延遲
} else if os.Getenv("BILI_WS_HOST_FORCE") == "AUTO" { // 否則從 api 獲取 host list 並提取低延遲

lowHost := api.GetLowLatencyHost(realRoom, false)

Expand All @@ -122,7 +122,7 @@ func LaunchLiveServer(
wsHost = lowHost
}

}
} // 否則繼續使用 biligo.WsDefaultHost

log.Debugf("[%v] 已採用 %v 作為直播 Host", realRoom, wsHost)

Expand Down

0 comments on commit 848475e

Please sign in to comment.