Exemplo n.º 1
0
        public override void Configure(ISuperSocketHostBuilder hostBuilder)
        {
            hostBuilder.ConfigureServices((ctx, services) =>
            {
                services.Configure <ServerOptions>((options) =>
                {
                    var listener = options.Listeners[0];
                });
            });
            hostBuilder.UseGZip();

            base.Configure(hostBuilder);
        }
Exemplo n.º 2
0
        public override void Configure(ISuperSocketHostBuilder hostBuilder)
        {
            hostBuilder.ConfigureServices((ctx, services) =>
            {
                services.Configure <ServerOptions>((options) =>
                {
                    var listener = options.Listeners[0];

                    if (listener.Security == SslProtocols.None)
                    {
                        listener.Security = GetServerEnabledSslProtocols();
                    }

                    listener.CertificateOptions = new CertificateOptions
                    {
                        FilePath = "supersocket.pfx",
                        Password = "******"
                    };
                });
            });

            hostBuilder.UseGZip();
            base.Configure(hostBuilder);
        }