Exemplo n.º 1
0
        static void Main(string[] args)
        {
            AuthMethods    authMethods = new AuthMethods();
            IChannelServer host        = ChannelServerBuilder.CreateServer();

            host.LoadAssemblies(AppDomain.CurrentDomain, null);
            host.AddTokenAuthentication(authMethods.AuthenticateToken);
            host.StartHosting(null);

            Console.ReadLine();
        }
        public static IApplicationBuilder UseNuclearChannels(this IApplicationBuilder app)
        {
            _server.LoadAssemblies(_appDomain);
            if (_tokenValidationDelegate != null)
            {
                _server.AuthenticationOptions(_tokenValidationDelegate);
            }
            if (_basicValidationDelegate != null)
            {
                _server.AuthenticationOptions(_basicValidationDelegate);
            }

            _server.StartHosting(_baseUrl);
            return(app);
        }
Exemplo n.º 3
0
        public static IApplicationBuilder UseChannels(this IApplicationBuilder app)
        {
            IChannelServer server = ChannelServerBuilder.CreateServer();

            //If you have channels or services in another project add them into your current AppDomain
            //Same goes for services if you use IServiceLocator from Nuclear.ExportLocator package
            server.LoadAssemblies(AppDomain.CurrentDomain);

            //Add authentication if you have for basic or for token authentication
            //server.AddTokenAuthentication( // your delegate goes here );
            //server.AddBasicAuthentication( // your delegate goes here );

            //or setup server.AuthenticationOption

            //Change the route for your web url
            server.StartHosting("https://localhost:44386");

            return(app);
        }