From 944027b30cc4039c7e025932dafea601af0a6267 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Tue, 24 Mar 2020 22:10:33 -0700 Subject: [PATCH] Assume http only for projects, not containers (#191) --- samples/multi-project/tye.yaml | 1 - src/Microsoft.Tye.Core/ApplicationFactory.cs | 3 ++- src/Microsoft.Tye.Hosting/ProxyService.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/multi-project/tye.yaml b/samples/multi-project/tye.yaml index 10287428..328f37f6 100644 --- a/samples/multi-project/tye.yaml +++ b/samples/multi-project/tye.yaml @@ -17,4 +17,3 @@ services: image: rabbitmq:3-management bindings: - port: 5672 - protocol: rabbitmq diff --git a/src/Microsoft.Tye.Core/ApplicationFactory.cs b/src/Microsoft.Tye.Core/ApplicationFactory.cs index ed4676ca..7952cb16 100644 --- a/src/Microsoft.Tye.Core/ApplicationFactory.cs +++ b/src/Microsoft.Tye.Core/ApplicationFactory.cs @@ -93,7 +93,8 @@ namespace Microsoft.Tye Protocol = configBinding.Protocol, }; - if (binding.ConnectionString == null) + // Assume HTTP for projects only (containers may be different) + if (binding.ConnectionString == null && configService.Project != null) { binding.Protocol ??= "http"; } diff --git a/src/Microsoft.Tye.Hosting/ProxyService.cs b/src/Microsoft.Tye.Hosting/ProxyService.cs index bc937b57..86059fb9 100644 --- a/src/Microsoft.Tye.Hosting/ProxyService.cs +++ b/src/Microsoft.Tye.Hosting/ProxyService.cs @@ -69,7 +69,7 @@ namespace Microsoft.Tye.Hosting binding.Port = GetNextPort(); } - if (binding.Protocol == "http" || binding.Protocol == null) + if (binding.Protocol == "http" || (binding.Protocol == null && service.ServiceType == Model.ServiceType.Project)) { binding.ContainerPort = 80; }