-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathProgram.cs
More file actions
41 lines (39 loc) · 1.32 KB
/
Program.cs
File metadata and controls
41 lines (39 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System.Diagnostics;
using System.Net;
using CoreWCF.Configuration;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Authentication.Negotiate;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
namespace NetCoreServer
{
class Program
{
static void Main(string[] args)
{
IWebHost host = CreateWebHostBuilder(args).Build();
host.Run();
}
// Listen on 8088 for http, and 8443 for https, 8089 for NetTcp.
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseKestrel(options => {
options.ListenAnyIP(Startup.HTTP_PORT);
options.ListenAnyIP(Startup.HTTPS_PORT, listenOptions =>
{
listenOptions.UseHttps();
if (Debugger.IsAttached)
{
listenOptions.UseConnectionLogging();
}
});
})
.ConfigureServices(options =>
{
options.AddAuthentication(NegotiateDefaults.AuthenticationScheme).AddNegotiate();
})
.UseNetTcp(Startup.NETTCP_PORT)
.UseStartup<Startup>();
}
}