30 lines
862 B
C#
30 lines
862 B
C#
|
using System.Net;
|
||
|
using Microsoft.AspNetCore;
|
||
|
using Microsoft.AspNetCore.Builder;
|
||
|
using Microsoft.AspNetCore.Hosting;
|
||
|
|
||
|
namespace UrlRewritingSample
|
||
|
{
|
||
|
public class Program
|
||
|
{
|
||
|
public static void Main(string[] args)
|
||
|
{
|
||
|
BuildWebHost(args).Run();
|
||
|
}
|
||
|
|
||
|
public static IWebHost BuildWebHost(string[] args) =>
|
||
|
WebHost.CreateDefaultBuilder(args)
|
||
|
.UseKestrel(options =>
|
||
|
{
|
||
|
options.Listen(IPAddress.Any, 5000);
|
||
|
options.Listen(IPAddress.Any, 5001);
|
||
|
options.Listen(IPAddress.Loopback, 443, listenOptions =>
|
||
|
{
|
||
|
listenOptions.UseHttps("testCert.pfx", "testPassword");
|
||
|
});
|
||
|
})
|
||
|
.UseStartup<Startup>()
|
||
|
.Build();
|
||
|
}
|
||
|
}
|