mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 12:40:07 +00:00
feat: 通过传递客户端Cookie的方式使web终端兼容被Cloudflare Access保护的面板
This commit is contained in:
@@ -275,13 +275,14 @@ func (cp *commonPage) terminal(c *gin.Context) {
|
||||
}, true)
|
||||
return
|
||||
}
|
||||
|
||||
var cloudflareCookies string
|
||||
cloudflareCookies, _ = c.Cookie("CF_Authorization")
|
||||
terminalData, _ := utils.Json.Marshal(&model.TerminalTask{
|
||||
Host: terminal.host,
|
||||
UseSSL: terminal.useSSL,
|
||||
Session: terminalID,
|
||||
Cookie: cloudflareCookies,
|
||||
})
|
||||
|
||||
if err := server.TaskStream.Send(&proto.Task{
|
||||
Type: model.TaskTypeTerminal,
|
||||
Data: string(terminalData),
|
||||
|
||||
Reference in New Issue
Block a user