public void Can_resolve_internal_ip()
        {
            var ipResolver = new IpResolver(new NetworkConfig(), LimboLogs.Instance);
            var address    = ipResolver.LocalIp;

            Assert.IsNotNull(address);
        }
Beispiel #2
0
        public void Should_resolve_ip_address_using_dns()
        {
            var address = IpResolver.ResolveDns("juso.duckdns.org").Result;

            Console.Write(address.ToString());

            address.Should().NotBeNull();
        }
Beispiel #3
0
        public void Should_resolve_ip_address_using_ipfy()
        {
            var address = IpResolver.ResolveIpfy().Result;

            Console.Write(address.ToString());

            address.Should().NotBeNull();
        }
Beispiel #4
0
 public HanziItem(IpResolver ipr, string hostAddr, char hanzi, bool found)
 {
     this.time     = DateTime.UtcNow;
     this.ipr      = ipr;
     this.hostAddr = hostAddr;
     this.hanzi    = hanzi;
     this.found    = found;
 }
Beispiel #5
0
        private T Notify <T>(IPrincipal?currentUser, Func <string, string, T> createNotification) where T : INotification
        {
            var currentUserId = GetCurrentUserId(currentUser);
            var ip            = IpResolver.GetCurrentRequestIpAddress();

            var notification = createNotification(currentUserId, ip);

            _eventAggregator.Publish(notification);
            return(notification);
        }
        public void Can_resolve_external_ip_with_override()
        {
            string         ipOverride    = "99.99.99.99";
            INetworkConfig networkConfig = new NetworkConfig();

            networkConfig.ExternalIp = ipOverride;
            var ipResolver = new IpResolver(networkConfig, LimboLogs.Instance);
            var address    = ipResolver.ExternalIp;

            Assert.AreEqual(IPAddress.Parse(ipOverride), address);
        }
Beispiel #7
0
        private QueryLogger()
        {
            ipResolver = new IpResolver();
            string logPath = HttpRuntime.AppDomainAppPath;

            logPath          = Path.Combine(logPath, @"_data\logs");
            this.logPath     = logPath;
            thr              = new Thread(threadFun);
            thr.IsBackground = true;
            thr.Start();
        }
Beispiel #8
0
 public QueryItem(IpResolver ipr, string hostAddr, bool isMobile, string uiLang,
                  UiScript script, UiTones tones,
                  int resCount, int msecLookup, int msecTotal,
                  SearchMode smode, string query)
 {
     this.ipr        = ipr;
     this.time       = DateTime.UtcNow;
     this.hostAddr   = hostAddr;
     this.isMobile   = isMobile;
     this.uiLang     = uiLang;
     this.script     = script;
     this.tones      = tones;
     this.resCount   = resCount;
     this.msecLookup = msecLookup;
     this.msecTotal  = msecTotal;
     this.smode      = smode;
     this.query      = query;
 }