feat: test proxy config
This commit is contained in:
@@ -27,3 +27,17 @@ export const getProxyConfig = async (): Promise<{ proxy_url: string, auth: boole
|
|||||||
return { proxy_url: '', auth: false };
|
return { proxy_url: '', auth: false };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const testProxyConfig = async (): Promise<{ success: boolean}> => {
|
||||||
|
try {
|
||||||
|
const response = await axios.get(`http://localhost:8080/proxy/test`);
|
||||||
|
if (response.status === 200) {
|
||||||
|
return response.data;
|
||||||
|
} else {
|
||||||
|
throw new Error(`Failed to test proxy configuration. Try again.`);
|
||||||
|
}
|
||||||
|
} catch (error: any) {
|
||||||
|
console.log(error);
|
||||||
|
return { success: false };
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user