MCPcopy Index your code
hub / github.com/pywebio/PyWebIO / is_http_backend

Function is_http_backend

webiojs/src/session.ts:356–369  ·  view source on GitHub ↗
(backend_addr: string)

Source from the content-addressed store, hash-verified

354* is_http_backend('http://localhost:8080/io').then(function(http_backend){ });
355* */
356export function is_http_backend(backend_addr: string) {
357 let url = new URL(backend_addr);
358 let protocol = url.protocol || window.location.protocol;
359 url.protocol = protocol.replace('wss', 'https').replace('ws', 'http');
360 backend_addr = url.href;
361
362 return new Promise(function (resolve, reject) {
363 $.get(backend_addr, {test: 1}, undefined, 'html').done(function (data: string) {
364 resolve(data === 'ok');
365 }).fail(function (e: JQuery.jqXHR) {
366 resolve(false);
367 });
368 });
369}
370
371
372// Send data to backend

Callers 1

startWebIOClientFunction · 0.90

Calls 1

getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…