a2acalling 0.6.26 → 0.6.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/routes/dashboard.js +31 -2
package/package.json
CHANGED
package/src/routes/dashboard.js
CHANGED
|
@@ -465,10 +465,26 @@ function createDashboardApiRouter(options = {}) {
|
|
|
465
465
|
let warnings = [];
|
|
466
466
|
let inviteResolution = null;
|
|
467
467
|
try {
|
|
468
|
+
// Determine default port based on config hostname:
|
|
469
|
+
// - If hostname has no port (e.g., "149.28.213.47"), assume port 80 (reverse proxy)
|
|
470
|
+
// - If hostname has explicit port, use that
|
|
471
|
+
// - Otherwise fall back to server port or env
|
|
472
|
+
const agent = context.config?.getAgent?.() || {};
|
|
473
|
+
const hostname = agent.hostname || '';
|
|
474
|
+
const hasExplicitPort = hostname.includes(':') && !hostname.startsWith('[');
|
|
475
|
+
let defaultPort;
|
|
476
|
+
if (hasExplicitPort) {
|
|
477
|
+
defaultPort = null; // Will be parsed from hostname
|
|
478
|
+
} else if (hostname && !hostname.includes('localhost')) {
|
|
479
|
+
defaultPort = 80; // External hostname without port = assume reverse proxy on 80
|
|
480
|
+
} else {
|
|
481
|
+
defaultPort = process.env.PORT || process.env.A2A_PORT || 80;
|
|
482
|
+
}
|
|
483
|
+
|
|
468
484
|
const resolved = await resolveInviteHost({
|
|
469
485
|
config: context.config,
|
|
470
486
|
fallbackHost: req.headers.host || process.env.HOSTNAME || 'localhost',
|
|
471
|
-
defaultPort
|
|
487
|
+
defaultPort,
|
|
472
488
|
refreshExternalIp: refreshIp,
|
|
473
489
|
forceRefreshExternalIp: refreshIp,
|
|
474
490
|
alwaysLookupExternalIp: true,
|
|
@@ -554,10 +570,23 @@ function createDashboardApiRouter(options = {}) {
|
|
|
554
570
|
let resolvedHost = null;
|
|
555
571
|
let warnings = [];
|
|
556
572
|
try {
|
|
573
|
+
// Use same port logic as /status endpoint
|
|
574
|
+
const agent = context.config?.getAgent?.() || {};
|
|
575
|
+
const hostname = agent.hostname || '';
|
|
576
|
+
const hasExplicitPort = hostname.includes(':') && !hostname.startsWith('[');
|
|
577
|
+
let defaultPort;
|
|
578
|
+
if (hasExplicitPort) {
|
|
579
|
+
defaultPort = null;
|
|
580
|
+
} else if (hostname && !hostname.includes('localhost')) {
|
|
581
|
+
defaultPort = 80;
|
|
582
|
+
} else {
|
|
583
|
+
defaultPort = process.env.PORT || process.env.A2A_PORT || 80;
|
|
584
|
+
}
|
|
585
|
+
|
|
557
586
|
const resolved = await resolveInviteHost({
|
|
558
587
|
config: context.config,
|
|
559
588
|
fallbackHost: req.headers.host || process.env.HOSTNAME || 'localhost',
|
|
560
|
-
defaultPort
|
|
589
|
+
defaultPort,
|
|
561
590
|
refreshExternalIp: true,
|
|
562
591
|
forceRefreshExternalIp: true
|
|
563
592
|
});
|