a2acalling 0.6.23 → 0.6.24

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/bin/cli.js CHANGED
@@ -407,15 +407,36 @@ async function resolveInviteHostname() {
407
407
  try {
408
408
  const { A2AConfig } = require('../src/lib/config');
409
409
  const config = new A2AConfig();
410
+ const agent = config.getAgent() || {};
411
+ const onboarding = config.getAll().onboarding || {};
412
+
413
+ // If hostname is set without a port (e.g., "149.28.213.47"), assume port 80
414
+ // (user configured reverse proxy or direct bind to 80)
415
+ // If hostname has a port (e.g., "149.28.213.47:3007"), use that port
416
+ // If no hostname set, use server_port from onboarding
417
+ const hostname = agent.hostname || '';
418
+ const hasExplicitPort = hostname.includes(':') && !hostname.startsWith('[');
419
+
420
+ let defaultPort;
421
+ if (hasExplicitPort) {
422
+ defaultPort = null; // Will be parsed from hostname
423
+ } else if (hostname && !hostname.includes('localhost')) {
424
+ // External hostname without port = assume port 80 (reverse proxy or direct)
425
+ defaultPort = 80;
426
+ } else {
427
+ // Local or no hostname - use actual server port
428
+ defaultPort = onboarding.server_port || process.env.PORT || process.env.A2A_PORT || 80;
429
+ }
430
+
410
431
  const resolved = await resolveInviteHost({
411
432
  config,
412
- defaultPort: process.env.PORT || process.env.A2A_PORT || 3001
433
+ defaultPort
413
434
  });
414
435
  return resolved;
415
436
  } catch (err) {
416
437
  return resolveInviteHost({
417
438
  fallbackHost: process.env.OPENCLAW_HOSTNAME || process.env.HOSTNAME || 'localhost',
418
- defaultPort: process.env.PORT || process.env.A2A_PORT || 3001
439
+ defaultPort: process.env.PORT || process.env.A2A_PORT || 80
419
440
  });
420
441
  }
421
442
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "a2acalling",
3
- "version": "0.6.23",
3
+ "version": "0.6.24",
4
4
  "description": "Agent-to-agent calling for OpenClaw - A2A agent communication",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -74,7 +74,8 @@ function formatHostPort(hostname, port) {
74
74
  if (!host) return '';
75
75
  const needsBrackets = net.isIP(host) === 6;
76
76
  const hostPart = needsBrackets ? `[${host}]` : host;
77
- return p ? `${hostPart}:${p}` : hostPart;
77
+ // Don't append port 80 (it's the default HTTP port)
78
+ return (p && p !== 80) ? `${hostPart}:${p}` : hostPart;
78
79
  }
79
80
 
80
81
  function isPrivateIpv4(ip) {