MCPcopy Create free account
hub / github.com/Milkyroad/SCiPNET / checkConnection

Function checkConnection

public/src/js/script.js:411–428  ·  view source on GitHub ↗
(target)

Source from the content-addressed store, hash-verified

409}
410
411async function checkConnection(target) {
412 const controller = new AbortController();
413 const timeoutId = setTimeout(() => controller.abort(), 4000);
414
415 try {
416 const response = await fetch(target, { signal: controller.signal });
417 clearTimeout(timeoutId);
418
419 if (!response.ok) {
420 throw new Error("Network response was not ok");
421 }
422
423 return response;
424 } catch (error) {
425 clearTimeout(timeoutId);
426 throw error;
427 }
428}
429
430window.checkall = async function () {
431 const proxies = [

Callers 1

script.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected