Skip to content

Commit a735aac

Browse files
committed
feat: link with protocol on shared ports
1 parent 1d4bf30 commit a735aac

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

site/src/modules/resources/PortForwardButton.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ export const PortForwardPopoverView: FC<PortForwardPopoverViewProps> = ({
393393
agent.name,
394394
workspaceName,
395395
username,
396+
share.protocol === "https",
396397
);
397398
const label = share.port;
398399
return (

site/src/utils/portForward.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ export const portForwardURL = (
44
agentName: string,
55
workspaceName: string,
66
username: string,
7+
https = false,
78
): string => {
89
const { location } = window;
10+
const suffix = https ? "s" : "";
911

10-
const subdomain = `${
11-
isNaN(port) ? 3000 : port
12-
}--${agentName}--${workspaceName}--${username}`;
12+
const subdomain = `${port
13+
}${suffix}--${agentName}--${workspaceName}--${username}`;
1314
return `${location.protocol}//${host}`.replace("*", subdomain);
1415
};
1516

@@ -53,6 +54,7 @@ export const openMaybePortForwardedURL = (
5354
portForwardURL(
5455
proxyHost,
5556
parseInt(url.port),
57+
5658
agentName,
5759
workspaceName,
5860
username,

0 commit comments

Comments
 (0)