1 instantiation of DevTunnelPortResource
Aspire.Hosting.DevTunnels (1)
DevTunnelResourceBuilderExtensions.cs (1)
610
var portResource = new
DevTunnelPortResource
(
74 references to DevTunnelPortResource
Aspire.Hosting.DevTunnels (37)
DevTunnelMonitor.cs (12)
41
private readonly Dictionary<
DevTunnelPortResource
, Task> _endpointEvents = [];
42
private readonly HashSet<
DevTunnelPortResource
> _allocatedEndpoints = [];
43
private readonly Dictionary<
DevTunnelPortResource
, Exception> _endpointErrors = [];
69
var ports = new Dictionary<
DevTunnelPortResource
, int>();
70
foreach (
var
port in _resource.Ports)
82
foreach (
var
port in ports.Keys)
105
foreach (
var
port in _resource.Ports)
323
private async Task RefreshAccessAsync(Run run,
DevTunnelPortResource
? port, int? portNumber)
628
private async Task PublishEndpointEventAsync(
DevTunnelPortResource
port)
678
private Task DeactivatePortUrlsAsync(
DevTunnelPortResource
port)
772
private sealed class Run(string tunnelId, Dictionary<
DevTunnelPortResource
, int> expectedPorts, string friendlyTunnelId, DateTimeOffset startedAt, CancellationToken stoppingToken)
775
public Dictionary<
DevTunnelPortResource
, int> ExpectedPorts { get; } = expectedPorts;
DevTunnelResource.cs (2)
37
internal List<
DevTunnelPortResource
> Ports { get; } = [];
61
/// Initializes a new instance of the <see cref="
DevTunnelPortResource
"/> class, representing a single forwarded endpoint/port on a dev tunnel.
DevTunnelResourceBuilderExtensions.cs (23)
158
foreach (
var
portResource in tunnelResource.Ports)
192
async Task StartPortAsync(
DevTunnelPortResource
portResource)
440
var
portResource = tunnelBuilder.Resource.Ports
463
var
portResource = tunnelBuilder.Resource.Ports
522
foreach (
var
port in tunnelResource.Resource.Ports.Where(p => p.TargetEndpoint.Resource == targetResource.Resource))
610
var
portResource = new DevTunnelPortResource(
635
DevTunnelPortResource
.ShowTunnelUrlsCommandName,
666
if (urls.FirstOrDefault(u => string.Equals(u.Endpoint?.EndpointName,
DevTunnelPortResource
.TunnelEndpointName, StringComparisons.EndpointAnnotationName)
674
if (urls.FirstOrDefault(u => string.Equals(u.Endpoint?.EndpointName,
DevTunnelPortResource
.TunnelEndpointName, StringComparisons.EndpointAnnotationName)
687
var
portResource = (
DevTunnelPortResource
)context.Resource;
717
internal static async Task UpdatePortAsync(
DevTunnelPortResource
portResource, bool available, ResourceNotificationService notifications, ResourceLoggerService logs, CancellationToken cancellationToken)
781
if (string.Equals(endpointName,
DevTunnelPortResource
.TunnelEndpointName, StringComparisons.EndpointAnnotationName)
806
internal static async Task UpdatePortAccessAsync(
DevTunnelPortResource
portResource, ResourceNotificationService notifications, ResourceLoggerService logs, DateTimeOffset now)
827
internal static async Task StopPortAsync(
DevTunnelPortResource
portResource, IServiceProvider services, CancellationToken cancellationToken)
853
private static async Task<ExecuteCommandResult> ShowTunnelUrlsAsync(
DevTunnelPortResource
portResource, ExecuteCommandContext context)
888
private static List<ResourcePropertySnapshot> GetUrlProperties(
DevTunnelPortResource
portResource)
897
new(
DevTunnelPortResource
.TunnelUrlPropertyName, NormalizeUrl(portUri))
906
properties.Add(new(
DevTunnelPortResource
.InspectUrlPropertyName, inspectUrl)
915
properties.Add(new(
DevTunnelPortResource
.LocalEndpointUrlPropertyName, localUrl)
937
name is
DevTunnelPortResource
.TunnelUrlPropertyName
938
or
DevTunnelPortResource
.InspectUrlPropertyName
939
or
DevTunnelPortResource
.LocalEndpointUrlPropertyName;
Aspire.Hosting.DevTunnels.Tests (33)
DevTunnelMonitorTests.cs (3)
256
var endpoint = test.Port.GetEndpoint(
DevTunnelPortResource
.TunnelEndpointName);
263
var tunnelUrl = Assert.Single(context.Urls, url => url.Endpoint?.EndpointName ==
DevTunnelPortResource
.TunnelEndpointName);
622
var
otherPort = Assert.Single(test.Tunnel.Ports, p => p.TargetEndpoint.EndpointName == "other");
DevTunnelResourceBuilderExtensionsTests.cs (29)
34
var
tunnelPort = tunnel.Resource.Ports.FirstOrDefault();
102
var
port = tunnel.Resource.Ports.First();
118
var
tunnelPort = Assert.Single(tunnel.Resource.Ports);
133
var
tunnelPort = Assert.Single(tunnel.Resource.Ports);
154
var
tunnelPort = Assert.Single(tunnel.Resource.Ports);
176
var
tunnelPort = Assert.Single(tunnel.Resource.Ports);
229
var
tunnelPort = Assert.Single(tunnel.Resource.Ports);
271
var
tunnelPort = Assert.Single(tunnel.Resource.Ports);
314
var
port = Assert.Single(tunnel.Resource.Ports);
378
var
port = Assert.Single(tunnel.Resource.Ports);
414
Assert.Equal(
DevTunnelPortResource
.TunnelEndpointName, tunnelEndpoint.EndpointName);
433
Assert.Equal(
DevTunnelPortResource
.TunnelEndpointName, tunnelEndpoint.EndpointName);
453
Assert.Equal(
DevTunnelPortResource
.TunnelEndpointName, tunnelEndpoint.EndpointName);
541
Assert.Equal(
DevTunnelPortResource
.TunnelEndpointName, httpTunnelEndpoint.EndpointName);
542
Assert.Equal(
DevTunnelPortResource
.TunnelEndpointName, httpsTunnelEndpoint.EndpointName);
561
var
port = Assert.Single(tunnel.Resource.Ports);
569
var command = Assert.Single(port.Annotations.OfType<ResourceCommandAnnotation>(), a => a.Name ==
DevTunnelPortResource
.ShowTunnelUrlsCommandName);
653
var
port = Assert.Single(tunnel.Resource.Ports);
659
var command = Assert.Single(port.Annotations.OfType<ResourceCommandAnnotation>(), a => a.Name ==
DevTunnelPortResource
.ShowTunnelUrlsCommandName);
703
var
port = Assert.Single(tunnel.Resource.Ports);
709
var command = Assert.Single(port.Annotations.OfType<ResourceCommandAnnotation>(), a => a.Name ==
DevTunnelPortResource
.ShowTunnelUrlsCommandName);
772
var
tunnelPort = Assert.Single(tunnel.Resource.Ports);
881
var
port = Assert.Single(tunnel.Resource.Ports);
895
DevTunnelPortResource
.TunnelUrlPropertyName or
896
DevTunnelPortResource
.InspectUrlPropertyName or
897
DevTunnelPortResource
.LocalEndpointUrlPropertyName),
900
Assert.Equal(
DevTunnelPortResource
.TunnelUrlPropertyName, property.Name);
907
Assert.Equal(
DevTunnelPortResource
.InspectUrlPropertyName, property.Name);
914
Assert.Equal(
DevTunnelPortResource
.LocalEndpointUrlPropertyName, property.Name);
TestDevTunnelMonitor.cs (1)
56
public
DevTunnelPortResource
Port { get; }
Aspire.Hosting.Maui.Tests (2)
MauiPlatformExtensionsTests.cs (2)
840
Assert.Equal("http", Assert.Single(appBuilder.Resources.OfType<
DevTunnelPortResource
>()).Options.Protocol);
1038
Assert.Equal("http", Assert.Single(appBuilder.Resources.OfType<
DevTunnelPortResource
>()).Options.Protocol);
Aspire.Hosting.Tests (2)
Dcp\DcpExecutorTests.cs (2)
1526
var
tunnelPort = Assert.Single(distributedAppModel.Resources.OfType<
DevTunnelPortResource
>());