Ejemplo n.º 1
0
        private static SshTunnelingHostListService PrepareSsh(IPAddress host, NetworkCredential creds)
        {
            var localPort = 8080;
            var http      = new HttpHostListService(
                new NetworkCredential("admin", "admin"),
                new IPEndPoint(IPAddress.Loopback, localPort));

            return(new SshTunnelingHostListService(
                       localPort,
                       HttpLocalhost,
                       host,
                       new NetworkCredential(creds.UserName, creds.Password),
                       http));
        }
Ejemplo n.º 2
0
        public IObservable <IEnumerable <desktop> > GetHostListAsync(IPAddress address, NetworkCredential creds)
        {
            IHostListService hostListService;

            if (_isSsh())
            {
                hostListService = PrepareSsh(address, creds);
            }
            else
            {
                hostListService =
                    new HttpHostListService(creds, new IPEndPoint(address, 80));
            }
            return(hostListService.GetHostListAsync());
        }
Ejemplo n.º 3
0
        public static IObservable <IEnumerable <desktop> > GetInfo(IPAddress address, NetworkCredential creds, bool useSsh = false)
        {
            IHostListService boundHostListService;

            if (useSsh)
            {
                boundHostListService = PrepareSsh(address, creds);
            }
            else
            {
                boundHostListService =
                    new HttpHostListService(creds, new IPEndPoint(address, 80));
            }

            //boundHostListService = new MockHostListService();
            return(boundHostListService.GetHostListAsync());
        }