MCPcopy Index your code
hub / github.com/coder/coder / resolveLocalhostPort

Function resolveLocalhostPort

site/src/utils/portForward.ts:15–23  ·  view source on GitHub ↗
(
	portStr: string,
	protocol: string,
)

Source from the content-addressed store, hash-verified

13 * always includes a trailing colon (e.g. `"https:"`).
14 */
15export const resolveLocalhostPort = (
16 portStr: string,
17 protocol: string,
18): number => {
19 if (portStr) {
20 return Number.parseInt(portStr, 10);
21 }
22 return protocol === "https:" ? 443 : 80;
23};
24
25export const portForwardURL = (
26 host: string,

Callers 2

rewriteLocalhostURLFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected