Пример #1
0
        static void Main(string[] args)
        {
            var builder = new HostBuilder()
                          .ConfigureServices((hostContext, services) =>
            {
                services.UseXRPC(s =>
                {
                    JWTHelper.Init();
                    s.ServerOptions.LogLevel           = BeetleX.EventArgs.LogType.Trace;
                    s.ServerOptions.DefaultListen.Port = 9090;
                    s.RPCOptions.ParameterFormater     = new JsonPacket();//default messagepack
                },
                                 typeof(Program).Assembly);
            });

            builder.Build().Run();
        }
Пример #2
0
 public static void Init()
 {
     byte[] key = new byte[128];
     new Random().NextBytes(key);
     Default = new JWTHelper("xrpc", "xrpc", key);
 }