You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd/demo-app/main.go
+21-21Lines changed: 21 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -31,23 +31,23 @@ func main() {
31
31
}
32
32
33
33
typedemoConfigstruct {
34
-
relayURLsstring
35
-
defaultRelaysbool
36
-
addrstring
37
-
namestring
38
-
descstring
39
-
tagsstring
40
-
ownerstring
41
-
hidebool
42
-
thumbnailstring
34
+
relayURLsstring
35
+
discoverybool
36
+
addrstring
37
+
namestring
38
+
descstring
39
+
tagsstring
40
+
ownerstring
41
+
hidebool
42
+
thumbnailstring
43
43
}
44
44
45
45
funcrunTCPCommand(args []string) error {
46
46
cfg:=demoConfig{}
47
47
48
48
fs:=utils.NewFlagSet("demo-app", printTCPUsage)
49
-
utils.StringFlagEnv(fs, &cfg.relayURLs, "relays", "https://localhost:4017", "additional relay API URLs (comma-separated; scheme omitted defaults to https; merged with public registry relays unless --default-relays=false is set)", "RELAYS")
50
-
utils.BoolFlagEnv(fs, &cfg.defaultRelays, "default-relays", true, "include public registry relays", "DEFAULT_RELAYS")
49
+
utils.StringFlagEnv(fs, &cfg.relayURLs, "relays", "https://gosunuts.xyz", "additional relay API URLs (comma-separated; scheme omitted defaults to https; merged with public registry relays when discovery is enabled)", "RELAYS")
50
+
utils.BoolFlagEnv(fs, &cfg.discovery, "discovery", true, "include public registry relays and enable discovery", "DISCOVERY")
51
51
utils.StringFlag(fs, &cfg.addr, "addr", "127.0.0.1:8092", "local demo HTTP listen address (host:port or URL; disable if empty)")
52
52
utils.StringFlag(fs, &cfg.name, "name", "demo-app", "public hostname prefix (single DNS label)")
utils.StringFlagEnv(fs, &cfg.relayURLs, "relays", "https://localhost:4017", "additional relay API URLs (comma-separated; scheme omitted defaults to https; merged with public registry relays unless --default-relays=false is set)", "RELAYS")
81
-
utils.BoolFlagEnv(fs, &cfg.defaultRelays, "default-relays", false, "include public registry relays", "DEFAULT_RELAYS")
80
+
utils.StringFlagEnv(fs, &cfg.relayURLs, "relays", "https://localhost:4017", "additional relay API URLs (comma-separated; scheme omitted defaults to https; merged with public registry relays when discovery is enabled)", "RELAYS")
81
+
utils.BoolFlagEnv(fs, &cfg.discovery, "discovery", true, "include public registry relays and enable discovery", "DISCOVERY")
82
82
utils.StringFlag(fs, &cfg.name, "name", "demo-udp", "public hostname prefix (single DNS label)")
-`--name` is optional. When omitted, the CLI generates a name for that run.
38
38
-`--relays` sets the relay API URLs for that run.
39
-
-`--default-relays=false` disables the public registry list for that run.
39
+
-`--discovery=false` disables the public registry seed list and the discovery expansion loop for that run.
40
40
41
41
Flags:
42
42
43
43
```text
44
44
--relays Portal relay API URLs (comma-separated, https only)
45
-
--default-relays Include public registry relays
45
+
--discovery Include public registry relays and discover additional relay bootstraps
46
46
--name Public hostname prefix (single DNS label); auto-generated when omitted
47
47
--description Service description metadata
48
48
--tags Service tags metadata (comma-separated)
@@ -54,7 +54,7 @@ Flags:
54
54
### `portal list [flags]`
55
55
56
56
- Prints the relay URLs that the CLI will use for the current invocation.
57
-
-`--relays` and `--default-relays=false`follow the same semantics as `portal expose`.
57
+
-`--relays`adds explicit relay URLs, and `--default-relays=false`disables the public registry list for the current listing run.
58
58
59
59
Legacy execution compatibility has been removed:
60
60
@@ -67,7 +67,7 @@ Legacy execution compatibility has been removed:
67
67
-`install.sh` installs the downloaded binary as `portal`.
68
68
-`install.ps1` installs `portal.exe` for the current Windows user and updates the user `PATH`.
69
69
- The installer does not write a config file.
70
-
-`portal expose 3000` still works after install because default relays are enabled.
70
+
-`portal expose 3000` still works after install because discovery is enabled by default.
71
71
- Use `--relays https://portal.example.com` only when you want to target a specific relay explicitly.
72
72
73
73
## Notes
@@ -77,7 +77,7 @@ Legacy execution compatibility has been removed:
77
77
- The tunnel consumes one aggregate SDK listener, so the CLI no longer manages per-relay listener loops itself.
78
78
- Relay startup and reconnect failures are retried independently in the background. A relay that is down does not stop healthy relays from continuing to serve traffic.
79
79
- The tunnel starts once relay URLs pass local validation. Remote compatibility checks, lease registration, and reconnects continue in the background until each relay becomes ready.
80
-
-The configured relay list is either`public registry + --relays values`or, with `--default-relays=false`, just the explicit relay URLs. Published public URLs appear only for relays that have registered successfully.
80
+
-With discovery enabled, the configured relay list starts with`public registry + --relays values`and can expand through relay discovery. With `--discovery=false`, only the explicit relay URLs are used. Published public URLs appear only for relays that have registered successfully.
81
81
- SDK callers that do not set `ListenerConfig.RetryCount` use infinite retry semantics for each relay.
82
82
- Tenant TLS is provisioned automatically through the relay keyless signer. The SDK fetches the relay certificate chain and uses `/v1/sign` for remote signing.
83
83
- When the local service is unreachable, the tunnel returns an HTTP 503 page.
utils.IntFlagEnv(fs, &cfg.UDPPortCount, "udp-port-count", 0, utils.ParseNonNegativeInt, "Number of UDP ports to allocate for leases, starting at port 50000 (0=disabled)", "UDP_PORT_COUNT")
64
64
utils.BoolFlagEnv(fs, &cfg.LandingPageEnabled, "landing-page-enabled", false, "enable landing page by default when no admin setting has been saved yet", "LANDING_PAGE_ENABLED")
65
65
utils.StringFlagEnv(fs, &cfg.Bootstraps, "bootstraps", "", "additional bootstrap relay API URLs used for discovery expansion", "BOOTSTRAPS")
utils.StringFlagEnv(fs, &cfg.OwnerPrivateKey, "owner-private-key", "", "relay owner private key used to derive a discovery address", "OWNER_PRIVATE_KEY")
Copy file name to clipboardExpand all lines: docs/architecture.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -115,13 +115,13 @@ That distinction matters because `/sdk/connect` stops being ordinary HTTP once h
115
115
116
116
### SDK (`sdk/`)
117
117
118
-
-`ExposeConfig.DefaultRelayEnabled`: when true, `Expose` fetches the default Portal relay registry, merges it with explicit relay inputs, and normalizes the result
118
+
-`ExposeConfig.Discovery`: when true, `Expose` fetches the default Portal relay registry, merges it with explicit relay inputs, normalizes the result, and runs the relay discovery loop
119
119
- Entry points can opt out of registry defaults and call `utils.NormalizeRelayURLs` directly when they need explicit relay inputs only
120
120
-`Listener`: validates one relay URL locally, then starts relay compatibility checks, lease registration, reverse session maintenance, and lease renewal in the background until ready
121
121
-`api_client.go`: internal relay client for control-plane requests, reverse session dialing, and internal QUIC tunnel setup
122
122
-`ListenerConfig.RetryCount <= 0` means retry forever; positive values close the listener after the retry budget is exhausted
123
123
-`NewListener` callers provide explicit normalized relay URLs
124
-
- Default exposure flow is `Expose{DefaultRelayEnabled: true} -> PublicURLs -> http.Server.Serve(exposure)`, with an opt-out path for explicit relay inputs only
124
+
- Default exposure flow is `Expose{Discovery: true} -> PublicURLs -> http.Server.Serve(exposure)`, with an opt-out path for explicit relay inputs only
125
125
-`expose.go`: optional `RunHTTP` helper for serving one handler on both a local HTTP port and the relay listener
126
126
-`Expose` keeps one listener per configured relay URL. Relay startup and reconnect failures are retried independently per relay, and successful relays remain available while failed relays keep retrying in the background
127
127
-`Exposure.RelayURLs()` returns the configured normalized relay URLs, while `Exposure.PublicURLs()` returns only relays that are currently registered and ready
0 commit comments