mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-29 03:24:54 +00:00
7 lines
394 B
TypeScript
7 lines
394 B
TypeScript
/**
|
|
* The origin another device opens to reach this machine from anywhere, or undefined while the server advertises none.
|
|
* The server itself listens over plain HTTP, so the HTTPS address among its URLs is its remote access tunnel.
|
|
*/
|
|
export function remoteAddress(urls: readonly string[]) {
|
|
return urls.map((value) => URL.parse(value)).find((url) => url?.protocol === "https:")?.origin
|
|
}
|