mirror of
https://github.com/woodchen-ink/clash-and-dashboard.git
synced 2025-07-18 14:01:56 +08:00
Fix: axios & fetch support https
This commit is contained in:
parent
8f9c2ec569
commit
bbce2eb69a
@ -101,7 +101,7 @@ export async function getInstance () {
|
||||
} = await getExternalControllerConfig()
|
||||
|
||||
instance = axios.create({
|
||||
baseURL: `http://${hostname}:${port}`,
|
||||
baseURL: `//${hostname}:${port}`,
|
||||
headers: secret ? { Authorization: `Bearer ${secret}` } : {}
|
||||
})
|
||||
|
||||
@ -146,7 +146,7 @@ export async function getLogsStreamReader () {
|
||||
}
|
||||
const externalController = await getExternalControllerConfig()
|
||||
const { data: config } = await getConfig()
|
||||
const logUrl = `http://${externalController.hostname}:${externalController.port}/logs?level=${config['log-level']}`
|
||||
const logUrl = `//${externalController.hostname}:${externalController.port}/logs?level=${config['log-level']}`
|
||||
const auth = externalController.secret ? { Authorization: `Bearer ${externalController.secret}` } : {}
|
||||
logsStreamReader = new StreamReader({ url: logUrl, bufferLength: 200, headers: auth })
|
||||
return logsStreamReader
|
||||
|
Loading…
x
Reference in New Issue
Block a user