Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): use listener port for managed tunnel origins #8353

Closedmateo-m(GitHub profile, opens in a new tab)wants to merge 7 commits intomain fromrefs/pull/8353/headopened View on GitHub

Showing 3 changed files with 101 additions and 3 deletions (loading 1).

x
0 of 3 viewed, 3 left
46 additions and 0 deletionsapps/server/src/cloud/http.test.tsModified
View file
@@ -35,6 +35,7 @@
consumeCloudReplayGuards,
isSupportedLinkProviderKind,
linkProofScopes,
+ managedTunnelOriginForAddress,
pendingServiceUpdateExists,
reconcileDesiredCloudLink,
releaseManagedTunnelOnShutdown,
@@ -609,3 +610,48 @@
expect(linkProofScopes(proofRequest("manual"))).toEqual(["agent_activity_notifications"]);
});
});
+​
+describe("managed tunnel listener origins", () => {
+ it("uses an IPv6 loopback listener", () => {
+ expect(
+ managedTunnelOriginForAddress({
+ _tag: "TcpAddress",
+ hostname: "::1",
+ port: 7331,
+ }),
+ ).toEqual({ localHttpHost: "::1", localHttpPort: 7331 });
+ });
+​
+ it("maps wildcard listeners to loopback hosts", () => {
+ expect(
+ managedTunnelOriginForAddress({
+ _tag: "TcpAddress",
+ hostname: "0.0.0.0",