Last active
July 30, 2018 17:10
-
-
Save thuru-zz/4d3be4b0aa5727cf5a911f1f3eb37341 to your computer and use it in GitHub Desktop.
Http Sys and Static Port in SF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected override IEnumerable<ServiceInstanceListener> CreateServiceInstanceListeners() | |
{ | |
return new ServiceInstanceListener[] | |
{ | |
new ServiceInstanceListener(serviceContext => | |
new HttpSysCommunicationListener(serviceContext, "GatewayHttpSysServiceEnpoint", (url, listener) => | |
{ | |
ServiceEventSource.Current.ServiceMessage(serviceContext, $"Starting HttpSys on {url}"); | |
return new WebHostBuilder() | |
.UseHttpSys() | |
.ConfigureServices( | |
services => services | |
.AddSingleton<StatelessServiceContext>(serviceContext)) | |
.UseContentRoot(Directory.GetCurrentDirectory()) | |
.UseStartup<Startup>() | |
.UseServiceFabricIntegration(listener, ServiceFabricIntegrationOptions.None) | |
.UseUrls(url) | |
.Build(); | |
})) | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Endpoints> | |
<Endpoint Protocol="http" Name="GatewayHttpSysServiceEnpoint" Type="Input" Port="8080"/> | |
</Endpoints> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment