Use proxy on requesting on android
This commit is contained in:
@@ -1363,7 +1363,7 @@ export async function fetchNative(url:string, arg:{
|
|||||||
}):Promise<{ body: ReadableStream<Uint8Array>; headers: Headers; status: number }> {
|
}):Promise<{ body: ReadableStream<Uint8Array>; headers: Headers; status: number }> {
|
||||||
let headers = arg.headers ?? {}
|
let headers = arg.headers ?? {}
|
||||||
const db = get(DataBase)
|
const db = get(DataBase)
|
||||||
let throughProxi = (!isTauri) && (!isNodeServer) && (!db.usePlainFetch) && (!Capacitor.isNativePlatform())
|
let throughProxy = (!isTauri) && (!isNodeServer) && (!db.usePlainFetch)
|
||||||
let fetchLogIndex = addFetchLog({
|
let fetchLogIndex = addFetchLog({
|
||||||
body: arg.body,
|
body: arg.body,
|
||||||
headers: arg.headers,
|
headers: arg.headers,
|
||||||
@@ -1373,7 +1373,7 @@ export async function fetchNative(url:string, arg:{
|
|||||||
resType: 'stream',
|
resType: 'stream',
|
||||||
chatId: arg.chatId
|
chatId: arg.chatId
|
||||||
})
|
})
|
||||||
if(isTauri || Capacitor.isNativePlatform()){
|
if(isTauri){
|
||||||
fetchIndex++
|
fetchIndex++
|
||||||
if(arg.signal && arg.signal.aborted){
|
if(arg.signal && arg.signal.aborted){
|
||||||
throw new Error('aborted')
|
throw new Error('aborted')
|
||||||
@@ -1468,7 +1468,7 @@ export async function fetchNative(url:string, arg:{
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(throughProxi){
|
else if(throughProxy){
|
||||||
const r = await fetch(hubURL + `/proxy2`, {
|
const r = await fetch(hubURL + `/proxy2`, {
|
||||||
body: arg.body,
|
body: arg.body,
|
||||||
headers: arg.useRisuTk ? {
|
headers: arg.useRisuTk ? {
|
||||||
|
|||||||
Reference in New Issue
Block a user