fix: correct proxy agent configuration and enhance testing
This commit is contained in:
parent
aa099bad37
commit
72038d9ad1
3 changed files with 225 additions and 73 deletions
|
|
@ -106,7 +106,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div v-if="loading" class="text-center">
|
<div v-if="loading" class="text-center">
|
||||||
<span class="loading loading-spinner loading-lg"></span>
|
<span class="loading loading-spinner loading-lg"></span>
|
||||||
<p class="mt-2">Running tests...</p>
|
<p class="mt-2">Running tests... This may take up to 60 seconds.</p>
|
||||||
|
<p class="text-sm text-base-content/70 mt-1">Testing proxy connectivity and SMS gateway endpoints.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -377,6 +378,57 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Global Error Display -->
|
||||||
|
<div v-if="testData?.error && !testData?.tests" class="card bg-base-100 shadow-xl mb-6">
|
||||||
|
<div class="card-body">
|
||||||
|
<h2 class="card-title text-2xl mb-4 text-error">Test Execution Failed</h2>
|
||||||
|
<div class="alert alert-error mb-4">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" class="stroke-current shrink-0 h-6 w-6" fill="none" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z" />
|
||||||
|
</svg>
|
||||||
|
<div>
|
||||||
|
<strong>{{ testData.errorType || 'Error' }}:</strong> {{ testData.error }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-4">
|
||||||
|
<div class="stat bg-base-200 rounded-lg">
|
||||||
|
<div class="stat-title">Test Type</div>
|
||||||
|
<div class="stat-value text-lg">{{ testData.testType || 'Unknown' }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="stat bg-base-200 rounded-lg">
|
||||||
|
<div class="stat-title">Duration</div>
|
||||||
|
<div class="stat-value text-lg">{{ testData.duration || 'Unknown' }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="stat bg-base-200 rounded-lg">
|
||||||
|
<div class="stat-title">Timestamp</div>
|
||||||
|
<div class="stat-value text-lg">{{ testData.timestamp ? new Date(testData.timestamp).toLocaleTimeString() : 'Unknown' }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="testData.details" class="collapse collapse-arrow bg-base-200">
|
||||||
|
<input type="checkbox" />
|
||||||
|
<div class="collapse-title text-xl font-medium">
|
||||||
|
Technical Details
|
||||||
|
</div>
|
||||||
|
<div class="collapse-content">
|
||||||
|
<pre class="text-sm bg-base-300 p-4 rounded-lg overflow-x-auto">{{ JSON.stringify(testData.details, null, 2) }}</pre>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mt-4 p-4 bg-info/10 rounded-lg">
|
||||||
|
<h3 class="font-semibold mb-2">Troubleshooting Tips:</h3>
|
||||||
|
<ul class="list-disc list-inside space-y-1 text-sm">
|
||||||
|
<li v-if="testData.errorType === 'Timeout'">Check if the WireGuard proxy container is running and accessible</li>
|
||||||
|
<li v-if="testData.errorType === 'Network Error'">Verify network connectivity and DNS resolution</li>
|
||||||
|
<li>Ensure SMS Gateway URL is correctly configured in environment variables</li>
|
||||||
|
<li>Check if the SMS Gateway service is running and accessible</li>
|
||||||
|
<li>Verify proxy configuration: http://wireguard:8888</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Error Summary -->
|
<!-- Error Summary -->
|
||||||
<div v-if="hasErrors" class="card bg-base-100 shadow-xl mb-6">
|
<div v-if="hasErrors" class="card bg-base-100 shadow-xl mb-6">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|
@ -417,8 +469,11 @@
|
||||||
Raw Test Data (JSON)
|
Raw Test Data (JSON)
|
||||||
</div>
|
</div>
|
||||||
<div class="collapse-content">
|
<div class="collapse-content">
|
||||||
|
<div class="mb-2 text-sm text-base-content/70">
|
||||||
|
Copy this data when reporting issues or debugging.
|
||||||
|
</div>
|
||||||
<pre
|
<pre
|
||||||
class="text-sm bg-base-300 p-4 rounded-lg overflow-x-auto"
|
class="text-sm bg-base-300 p-4 rounded-lg overflow-x-auto select-all"
|
||||||
>{{ JSON.stringify(testData, null, 2) }}</pre
|
>{{ JSON.stringify(testData, null, 2) }}</pre
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -480,15 +535,52 @@ const errorSummary = computed(() => {
|
||||||
|
|
||||||
const runTests = async (testType = "all") => {
|
const runTests = async (testType = "all") => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
|
const startTime = Date.now();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await $fetch(`/api/proxy-test?test=${testType}`);
|
// Set a generous timeout (60 seconds) for comprehensive tests
|
||||||
|
const controller = new AbortController();
|
||||||
|
const timeoutId = setTimeout(() => {
|
||||||
|
controller.abort();
|
||||||
|
}, 60000);
|
||||||
|
|
||||||
|
const response = await $fetch(`/api/proxy-test?test=${testType}`, {
|
||||||
|
signal: controller.signal,
|
||||||
|
timeout: 60000
|
||||||
|
});
|
||||||
|
|
||||||
|
clearTimeout(timeoutId);
|
||||||
testData.value = response;
|
testData.value = response;
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
const duration = Date.now() - startTime;
|
||||||
console.error("Failed to run tests:", error);
|
console.error("Failed to run tests:", error);
|
||||||
testData.value = {
|
|
||||||
error: error.message,
|
// Provide comprehensive error information
|
||||||
|
const errorInfo = {
|
||||||
|
error: error.message || 'Unknown error occurred',
|
||||||
|
errorType: error.name || 'Error',
|
||||||
|
duration: `${duration}ms`,
|
||||||
timestamp: new Date().toISOString(),
|
timestamp: new Date().toISOString(),
|
||||||
|
testType,
|
||||||
|
details: {
|
||||||
|
code: error.code,
|
||||||
|
status: error.status || error.statusCode,
|
||||||
|
data: error.data,
|
||||||
|
stack: error.stack
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Handle specific error types
|
||||||
|
if (error.name === 'AbortError' || error.message?.includes('aborted')) {
|
||||||
|
errorInfo.error = `Test timed out after ${duration}ms. The proxy or SMS gateway may be unreachable.`;
|
||||||
|
errorInfo.errorType = 'Timeout';
|
||||||
|
} else if (error.name === 'FetchError' || error.message?.includes('fetch')) {
|
||||||
|
errorInfo.error = `Network error: ${error.message}. Check proxy configuration and network connectivity.`;
|
||||||
|
errorInfo.errorType = 'Network Error';
|
||||||
|
}
|
||||||
|
|
||||||
|
testData.value = errorInfo;
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,31 @@
|
||||||
import { ProxyAgent } from "undici";
|
|
||||||
import { httpFetchClient } from "../lib/http-client.js";
|
import { httpFetchClient } from "../lib/http-client.js";
|
||||||
|
import { createSmsGatewayClient } from "../lib/sms-gateway";
|
||||||
const proxyAgent = new ProxyAgent("http://wireguard:8888");
|
|
||||||
|
|
||||||
async function testEndpoint(url, useProxy = true, options = {}) {
|
async function testEndpoint(url, useProxy = true, options = {}) {
|
||||||
const startTime = Date.now();
|
const startTime = Date.now();
|
||||||
try {
|
try {
|
||||||
|
let response;
|
||||||
|
|
||||||
|
if (useProxy) {
|
||||||
|
if (options.method === "POST") {
|
||||||
|
response = await httpFetchClient.post(
|
||||||
|
url,
|
||||||
|
options.body,
|
||||||
|
options.headers,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
response = await httpFetchClient.get(url, options.headers);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
const fetchOptions = {
|
const fetchOptions = {
|
||||||
method: options.method || "GET",
|
method: options.method || "GET",
|
||||||
headers: options.headers || {},
|
headers: options.headers || {},
|
||||||
|
timeout: 15000,
|
||||||
...options,
|
...options,
|
||||||
};
|
};
|
||||||
|
response = await $fetch(url, fetchOptions);
|
||||||
if (useProxy) {
|
|
||||||
fetchOptions.agent = proxyAgent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await $fetch(url, fetchOptions);
|
|
||||||
const endTime = Date.now();
|
const endTime = Date.now();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
@ -26,7 +35,7 @@ async function testEndpoint(url, useProxy = true, options = {}) {
|
||||||
responseTime: endTime - startTime,
|
responseTime: endTime - startTime,
|
||||||
status: response.status || 200,
|
status: response.status || 200,
|
||||||
data: response,
|
data: response,
|
||||||
error: null
|
error: null,
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const endTime = Date.now();
|
const endTime = Date.now();
|
||||||
|
|
@ -35,26 +44,27 @@ async function testEndpoint(url, useProxy = true, options = {}) {
|
||||||
url,
|
url,
|
||||||
useProxy,
|
useProxy,
|
||||||
responseTime: endTime - startTime,
|
responseTime: endTime - startTime,
|
||||||
status: error.status || null,
|
status: error.status || error.statusCode || null,
|
||||||
data: null,
|
data: null,
|
||||||
error: {
|
error: {
|
||||||
message: error.message,
|
message: error.message,
|
||||||
code: error.code,
|
code: error.code,
|
||||||
stack: error.stack
|
name: error.name,
|
||||||
}
|
stack: process.env.NODE_ENV === "development" ? error.stack : undefined,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function testDNSResolution(hostname) {
|
async function testDNSResolution(hostname) {
|
||||||
try {
|
try {
|
||||||
const dns = await import('dns').then(m => m.promises);
|
const dns = await import("dns").then((m) => m.promises);
|
||||||
const addresses = await dns.lookup(hostname);
|
const addresses = await dns.lookup(hostname);
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
hostname,
|
hostname,
|
||||||
addresses,
|
addresses,
|
||||||
error: null
|
error: null,
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return {
|
return {
|
||||||
|
|
@ -63,8 +73,8 @@ async function testDNSResolution(hostname) {
|
||||||
addresses: null,
|
addresses: null,
|
||||||
error: {
|
error: {
|
||||||
message: error.message,
|
message: error.message,
|
||||||
code: error.code
|
code: error.code,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -72,7 +82,7 @@ async function testDNSResolution(hostname) {
|
||||||
export default defineEventHandler(async (event) => {
|
export default defineEventHandler(async (event) => {
|
||||||
const config = useRuntimeConfig();
|
const config = useRuntimeConfig();
|
||||||
const query = getQuery(event);
|
const query = getQuery(event);
|
||||||
const testType = query.test || 'all';
|
const testType = query.test || "all";
|
||||||
|
|
||||||
const results = {
|
const results = {
|
||||||
timestamp: new Date().toISOString(),
|
timestamp: new Date().toISOString(),
|
||||||
|
|
@ -80,59 +90,115 @@ export default defineEventHandler(async (event) => {
|
||||||
nodeEnv: process.env.NODE_ENV,
|
nodeEnv: process.env.NODE_ENV,
|
||||||
proxyUrl: "http://wireguard:8888",
|
proxyUrl: "http://wireguard:8888",
|
||||||
smsGatewayUrl: config.androidSmsGatewayUrl,
|
smsGatewayUrl: config.androidSmsGatewayUrl,
|
||||||
smsGatewayBypass: config.androidSmsGatewayBypass
|
smsGatewayBypass: config.androidSmsGatewayBypass,
|
||||||
},
|
},
|
||||||
tests: {}
|
tests: {},
|
||||||
};
|
};
|
||||||
|
|
||||||
// DNS Resolution Tests
|
// DNS Resolution Tests
|
||||||
if (testType === 'all' || testType === 'dns') {
|
if (testType === "all" || testType === "dns") {
|
||||||
results.tests.dns = {
|
results.tests.dns = {
|
||||||
wireguard: await testDNSResolution('wireguard'),
|
wireguard: await testDNSResolution("wireguard"),
|
||||||
google: await testDNSResolution('google.com'),
|
google: await testDNSResolution("google.com"),
|
||||||
httpbin: await testDNSResolution('httpbin.org')
|
httpbin: await testDNSResolution("httpbin.org"),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Basic Connectivity Tests
|
// Basic Connectivity Tests
|
||||||
if (testType === 'all' || testType === 'connectivity') {
|
if (testType === "all" || testType === "connectivity") {
|
||||||
results.tests.connectivity = {};
|
results.tests.connectivity = {};
|
||||||
|
|
||||||
// Test known good endpoints
|
// Test known good endpoints
|
||||||
const testEndpoints = [
|
const testEndpoints = [
|
||||||
'https://httpbin.org/get',
|
"https://httpbin.org/get",
|
||||||
'https://google.com',
|
"https://google.com",
|
||||||
'https://api.github.com'
|
"https://api.github.com",
|
||||||
];
|
];
|
||||||
|
|
||||||
for (const endpoint of testEndpoints) {
|
for (const endpoint of testEndpoints) {
|
||||||
const endpointKey = endpoint.replace(/[^a-zA-Z0-9]/g, '_');
|
const endpointKey = endpoint.replace(/[^a-zA-Z0-9]/g, "_");
|
||||||
results.tests.connectivity[`${endpointKey}_direct`] = await testEndpoint(endpoint, false);
|
results.tests.connectivity[`${endpointKey}_direct`] = await testEndpoint(
|
||||||
results.tests.connectivity[`${endpointKey}_proxy`] = await testEndpoint(endpoint, true);
|
endpoint,
|
||||||
|
false,
|
||||||
|
);
|
||||||
|
results.tests.connectivity[`${endpointKey}_proxy`] = await testEndpoint(
|
||||||
|
endpoint,
|
||||||
|
true,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// SMS Gateway Specific Tests
|
// SMS Gateway Specific Tests
|
||||||
if (testType === 'all' || testType === 'sms') {
|
if (testType === "all" || testType === "sms") {
|
||||||
results.tests.smsGateway = {};
|
results.tests.smsGateway = {};
|
||||||
|
|
||||||
if (config.androidSmsGatewayUrl) {
|
if (config.androidSmsGatewayUrl) {
|
||||||
// Test basic connectivity to SMS gateway
|
|
||||||
const smsUrl = config.androidSmsGatewayUrl;
|
const smsUrl = config.androidSmsGatewayUrl;
|
||||||
results.tests.smsGateway.proxy = await testEndpoint(smsUrl, true);
|
|
||||||
|
|
||||||
// Test SMS gateway health endpoint if available
|
// Test SMS gateway health endpoint
|
||||||
const healthUrl = `${smsUrl}/health`;
|
const healthUrl = `${smsUrl}/health`;
|
||||||
results.tests.smsGateway.health_proxy = await testEndpoint(healthUrl, true);
|
results.tests.smsGateway.health_proxy = await testEndpoint(
|
||||||
|
healthUrl,
|
||||||
|
true,
|
||||||
|
);
|
||||||
|
|
||||||
// Test with authentication headers
|
// Test with authentication headers
|
||||||
if (config.androidSmsGatewayLogin && config.androidSmsGatewayPassword) {
|
if (config.androidSmsGatewayLogin && config.androidSmsGatewayPassword) {
|
||||||
const authHeaders = {
|
const authHeaders = {
|
||||||
'Authorization': `Basic ${Buffer.from(`${config.androidSmsGatewayLogin}:${config.androidSmsGatewayPassword}`).toString('base64')}`
|
Authorization: `Basic ${Buffer.from(`${config.androidSmsGatewayLogin}:${config.androidSmsGatewayPassword}`).toString("base64")}`,
|
||||||
};
|
};
|
||||||
|
|
||||||
results.tests.smsGateway.auth_direct = await testEndpoint(smsUrl, false, { headers: authHeaders });
|
// Test authenticated status endpoint (this simulates real SMS gateway usage)
|
||||||
results.tests.smsGateway.auth_proxy = await testEndpoint(smsUrl, true, { headers: authHeaders });
|
results.tests.smsGateway.auth_status_proxy = await testEndpoint(
|
||||||
|
smsUrl + "/device",
|
||||||
|
true,
|
||||||
|
{ headers: authHeaders },
|
||||||
|
);
|
||||||
|
|
||||||
|
const api = createSmsGatewayClient(config);
|
||||||
|
const message = {
|
||||||
|
phoneNumbers: ["2067452154"],
|
||||||
|
message: `Testing 1 2 3...`,
|
||||||
|
};
|
||||||
|
const startTime = Date.now();
|
||||||
|
try {
|
||||||
|
const msg_id = (await api.send(message)).id;
|
||||||
|
await new Promise((r) => setTimeout(r, 3000));
|
||||||
|
const state = await api.getState(msg_id);
|
||||||
|
const endTime = Date.now();
|
||||||
|
|
||||||
|
results.tests.smsGateway.auth_api_send_msg = {
|
||||||
|
success: true,
|
||||||
|
url: null,
|
||||||
|
useProxy: true,
|
||||||
|
responseTime: endTime - startTime,
|
||||||
|
status: state.state,
|
||||||
|
data: "msg_id: " + state.id,
|
||||||
|
error: null,
|
||||||
|
};
|
||||||
|
} catch (error) {
|
||||||
|
const endTime = Date.now();
|
||||||
|
results.tests.smsGateway.auth_api_send_msg = {
|
||||||
|
success: false,
|
||||||
|
url: null,
|
||||||
|
useProxy: true,
|
||||||
|
responseTime: endTime - startTime,
|
||||||
|
status: error.status || error.statusCode || null,
|
||||||
|
data: null,
|
||||||
|
error: {
|
||||||
|
message: error.message,
|
||||||
|
code: error.code,
|
||||||
|
name: error.name,
|
||||||
|
stack:
|
||||||
|
process.env.NODE_ENV === "development"
|
||||||
|
? error.stack
|
||||||
|
: undefined,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
results.tests.smsGateway.auth_error =
|
||||||
|
"SMS Gateway credentials not configured";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
results.tests.smsGateway.error = "SMS Gateway URL not configured";
|
results.tests.smsGateway.error = "SMS Gateway URL not configured";
|
||||||
|
|
@ -140,14 +206,12 @@ export default defineEventHandler(async (event) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// HTTP Client Library Test
|
// HTTP Client Library Test
|
||||||
if (testType === 'all' || testType === 'httpclient') {
|
if (testType === "all" || testType === "httpclient") {
|
||||||
results.tests.httpClient = {};
|
results.tests.httpClient = {};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Test using your existing http client
|
// Test using your existing http client
|
||||||
const testResult = await httpFetchClient.get('https://httpbin.org/get', {
|
const testResult = await httpFetchClient.get("https://httpbin.org/get");
|
||||||
'User-Agent': 'Portfolio-Proxy-Test/1.0'
|
|
||||||
});
|
|
||||||
|
|
||||||
results.tests.httpClient.success = true;
|
results.tests.httpClient.success = true;
|
||||||
results.tests.httpClient.data = testResult;
|
results.tests.httpClient.data = testResult;
|
||||||
|
|
@ -163,18 +227,13 @@ export default defineEventHandler(async (event) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Proxy Agent Direct Test
|
// Proxy Agent Direct Test (using httpFetchClient)
|
||||||
if (testType === 'all' || testType === 'proxyagent') {
|
if (testType === "all" || testType === "proxyagent") {
|
||||||
results.tests.proxyAgent = {};
|
results.tests.proxyAgent = {};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Test proxy agent directly
|
// Test proxy agent using httpFetchClient (which uses ProxyAgent internally)
|
||||||
const response = await $fetch('https://httpbin.org/ip', {
|
const response = await httpFetchClient.get("https://httpbin.org/ip");
|
||||||
agent: proxyAgent,
|
|
||||||
headers: {
|
|
||||||
'User-Agent': 'Portfolio-Proxy-Test/1.0'
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
results.tests.proxyAgent.success = true;
|
results.tests.proxyAgent.success = true;
|
||||||
results.tests.proxyAgent.data = response;
|
results.tests.proxyAgent.data = response;
|
||||||
|
|
@ -185,7 +244,8 @@ export default defineEventHandler(async (event) => {
|
||||||
results.tests.proxyAgent.error = {
|
results.tests.proxyAgent.error = {
|
||||||
message: error.message,
|
message: error.message,
|
||||||
code: error.code,
|
code: error.code,
|
||||||
stack: error.stack
|
name: error.name,
|
||||||
|
stack: process.env.NODE_ENV === "development" ? error.stack : undefined,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
import { ProxyAgent } from "undici";
|
import { ProxyAgent } from "undici";
|
||||||
|
|
||||||
const proxyAgent = new ProxyAgent("http://wireguard:8888");
|
const proxyAgent = new ProxyAgent("http://wireguard:8888");
|
||||||
const REQUEST_TIMEOUT = 5000;
|
const REQUEST_TIMEOUT = 15000;
|
||||||
|
|
||||||
export const httpFetchClient = {
|
export const httpFetchClient = {
|
||||||
get: async (url, headers) => {
|
get: async (url, headers) => {
|
||||||
const response = await $fetch(url, {
|
const response = await $fetch(url, {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
headers,
|
headers,
|
||||||
agent: proxyAgent,
|
dispatcher: proxyAgent,
|
||||||
timeout: REQUEST_TIMEOUT,
|
timeout: REQUEST_TIMEOUT,
|
||||||
});
|
});
|
||||||
return response;
|
return response;
|
||||||
|
|
@ -18,7 +18,7 @@ export const httpFetchClient = {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json", ...headers },
|
headers: { "Content-Type": "application/json", ...headers },
|
||||||
body: JSON.stringify(body),
|
body: JSON.stringify(body),
|
||||||
agent: proxyAgent,
|
dispatcher: proxyAgent,
|
||||||
timeout: REQUEST_TIMEOUT,
|
timeout: REQUEST_TIMEOUT,
|
||||||
});
|
});
|
||||||
return response;
|
return response;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue