Exemple #1
0
        static void Main(string[] args)
        {
            var proxy = new RpcServerProxy("server01", "http://localhost:58355");

            Console.WriteLine("Ready");
            Console.ReadLine();
        }
Exemple #2
0
        public async Task ProxyIntegrationTest(string protocol)
        {
            // create test node server
            using (var server = new TestNodeServer())
            {
                await server.RpcServer.StartAsync();

                // create proxy server pointed to test node server
                var httpServerEndPoint = new Uri($"{protocol}://{IPAddress.Loopback}:{server.RpcServer.ServerPort}");
                using (var proxyServer = new RpcServerProxy(httpServerEndPoint))
                {
                    await proxyServer.StartServerAsync();

                    // create rpc client pointed to proxy server
                    var proxyServerUri = new Uri($"{protocol}://{IPAddress.Loopback}:{proxyServer.ProxyServerPort}");
                    using (var client = JsonRpcClient.Create(proxyServerUri, 100, 100))
                    {
                        var version = await client.Version();
                    }
                }
            }
        }