コード例 #1
0
        public async Task Connect()
        {
            var request = new VpnConnectionRequest(
                Servers(),
                VpnProtocol.Auto,
                VpnConfig(),
                new VpnCredentials(_config.GuestHoleVpnUsername, _config.GuestHoleVpnPassword));

            await _vpnServiceManager.Connect(request);
        }
コード例 #2
0
        public async Task Connect_PicksFastestServer()
        {
            // Arrange
            List <Server> expectedServers = new List <Server>
            {
                _torServer,
                _standardServer,
                _p2pServer
            };

            _vpnServiceManager.Connect(Arg.Any <VpnConnectionRequest>())
            .Returns((arg) => AssertConnectionAsync(arg, expectedServers));

            _appSettings.FeaturePortForwardingEnabled = true;
            _appSettings.PortForwardingEnabled        = false;

            // Act
            await _profileConnector.Connect(_candidates, _profile);
        }
コード例 #3
0
        private async Task Connect(IEnumerable <Server> servers, VpnProtocol protocol)
        {
            var request = new VpnConnectionRequest(
                Servers(servers),
                protocol,
                VpnConfig(),
                _vpnCredentialProvider.Credentials());

            await _vpnServiceManager.Connect(request);

            _logger.Info("Connect requested");
            _modals.CloseAll();
        }
コード例 #4
0
 public async Task Connect(VpnConnectionRequest connectionRequest)
 {
     await InvokeAction(() => _decorated.Connect(connectionRequest));
 }