runpod address bug fix

This commit is contained in:
robertvoy
2025-07-16 12:33:24 +10:00
parent 026c1de643
commit 24c6b41a73
+9 -4
View File
@@ -275,10 +275,15 @@ class DistributedExtension {
// For local workers on Runpod, construct the port-specific proxy URL
let finalHost = host;
if (!worker.host && isRunpodProxy) {
// Extract pod ID from current host (format: podId-xxxx.proxy.runpod.net)
const podId = host.split('-')[0];
const domain = host.substring(host.indexOf('-') + 1);
finalHost = `${podId}-${worker.port}.${domain}`;
const match = host.match(/^(.*)\.proxy\.runpod\.net$/);
if (match) {
const podId = match[1];
const domain = 'proxy.runpod.net';
finalHost = `${podId}-${worker.port}.${domain}`;
} else {
// Fallback or log error if no match (shouldn't happen)
console.error(`[Distributed] Failed to parse Runpod proxy host: ${host}`);
}
}
// Determine protocol: HTTPS for cloud, Runpod proxies, or port 443