private void populateServerIpAddress(HarEntry harEntry) { // populate the server IP address if it was resolved as part of this request. otherwise, populate the IP address from the cache. if (resolvedAddress != null) { harEntry.setServerIPAddress(resolvedAddress.getHostAddress()); } else { String serverHost = HttpUtil.getHostFromRequest(modifiedHttpRequest); if (serverHost != null && !serverHost.isEmpty()) { String resolvedAddress = ResolvedHostnameCacheFilter.getPreviouslyResolvedAddressForHost(serverHost); if (resolvedAddress != null) { harEntry.setServerIPAddress(resolvedAddress); } else { // the resolvedAddress may be null if the ResolvedHostnameCacheFilter has expired the entry (which is unlikely), // or in the far more common case that the proxy is using a chained proxy to connect to connect to the // remote host. since the chained proxy handles IP address resolution, the IP address in the HAR must be blank. log.trace("Unable to find cached IP address for host: {}. IP address in HAR entry will be blank.", serverHost); } } else { log.warn("Unable to identify host from request uri: {}", modifiedHttpRequest.getUri()); } } }
/** * Populates the serverIpAddress field of the harEntry using the internal hostname->IP address cache. * * @param httpRequest HTTP request to take the hostname from */ protected void populateAddressFromCache(HttpRequest httpRequest) { String serverHost = getHost(httpRequest); if (serverHost != null && !serverHost.isEmpty()) { String resolvedAddress = ResolvedHostnameCacheFilter.getPreviouslyResolvedAddressForHost(serverHost); if (resolvedAddress != null) { harEntry.setServerIPAddress(resolvedAddress); } else { // the resolvedAddress may be null if the ResolvedHostnameCacheFilter has expired the entry (which is unlikely), // or in the far more common case that the proxy is using a chained proxy to connect to connect to the // remote host. since the chained proxy handles IP address resolution, the IP address in the HAR must be blank. log.trace("Unable to find cached IP address for host: {}. IP address in HAR entry will be blank.", serverHost); } } else { log.warn("Unable to identify host from request uri: {}", httpRequest.getUri()); } }
@Override public void proxyToServerResolutionSucceeded(String serverHostAndPort, InetSocketAddress resolvedRemoteAddress) { long dnsResolutionFinishedNanos = System.nanoTime(); if (dnsResolutionStartedNanos > 0L) { harEntry.getTimings().setDns(dnsResolutionFinishedNanos - dnsResolutionStartedNanos, TimeUnit.NANOSECONDS); } else { harEntry.getTimings().setDns(0L, TimeUnit.NANOSECONDS); } // the address *should* always be resolved at this point InetAddress resolvedAddress = resolvedRemoteAddress.getAddress(); if (resolvedAddress != null) { addressResolved = true; harEntry.setServerIPAddress(resolvedAddress.getHostAddress()); } }
private void populateServerIpAddress(HarEntry harEntry) { // populate the server IP address if it was resolved as part of this request. otherwise, populate the IP address from the cache. if (resolvedAddress != null) { harEntry.setServerIPAddress(resolvedAddress.getHostAddress()); } else { String serverHost = HttpUtil.getHostFromRequest(modifiedHttpRequest); if (serverHost != null && !serverHost.isEmpty()) { String resolvedAddress = ResolvedHostnameCacheFilter.getPreviouslyResolvedAddressForHost(serverHost); if (resolvedAddress != null) { harEntry.setServerIPAddress(resolvedAddress); } else { log.warn("Unable to find cached IP address for host: {}. IP address in HAR entry will be blank.", serverHost); } } else { log.warn("Unable to identify host from request uri: {}", modifiedHttpRequest.getUri()); } } }
private void populateServerIpAddress(HarEntry harEntry) { // populate the server IP address if it was resolved as part of this request. otherwise, populate the IP address from the cache. if (resolvedAddress != null) { harEntry.setServerIPAddress(resolvedAddress.getHostAddress()); } else { String serverHost = HttpUtil.getHostFromRequest(modifiedHttpRequest); if (serverHost != null && !serverHost.isEmpty()) { String resolvedAddress = ResolvedHostnameCacheFilter.getPreviouslyResolvedAddressForHost(serverHost); if (resolvedAddress != null) { harEntry.setServerIPAddress(resolvedAddress); } else { // the resolvedAddress may be null if the ResolvedHostnameCacheFilter has expired the entry (which is unlikely), // or in the far more common case that the proxy is using a chained proxy to connect to connect to the // remote host. since the chained proxy handles IP address resolution, the IP address in the HAR must be blank. log.trace("Unable to find cached IP address for host: {}. IP address in HAR entry will be blank.", serverHost); } } else { log.warn("Unable to identify host from request uri: {}", modifiedHttpRequest.getUri()); } } }
private void populateServerIpAddress(HarEntry harEntry) { // populate the server IP address if it was resolved as part of this request. otherwise, populate the IP address from the cache. if (resolvedAddress != null) { harEntry.setServerIPAddress(resolvedAddress.getHostAddress()); } else { String serverHost = HttpUtil.getHostFromRequest(modifiedHttpRequest); if (serverHost != null && !serverHost.isEmpty()) { String resolvedAddress = ResolvedHostnameCacheFilter.getPreviouslyResolvedAddressForHost(serverHost); if (resolvedAddress != null) { harEntry.setServerIPAddress(resolvedAddress); } else { // the resolvedAddress may be null if the ResolvedHostnameCacheFilter has expired the entry (which is unlikely), // or in the far more common case that the proxy is using a chained proxy to connect to connect to the // remote host. since the chained proxy handles IP address resolution, the IP address in the HAR must be blank. log.trace("Unable to find cached IP address for host: {}. IP address in HAR entry will be blank.", serverHost); } } else { log.warn("Unable to identify host from request uri: {}", modifiedHttpRequest.getUri()); } } }
/** * Populates the serverIpAddress field of the harEntry using the internal hostname->IP address cache. * * @param httpRequest HTTP request to take the hostname from */ protected void populateAddressFromCache(HttpRequest httpRequest) { String serverHost = getHost(httpRequest); if (serverHost != null && !serverHost.isEmpty()) { String resolvedAddress = ResolvedHostnameCacheFilter.getPreviouslyResolvedAddressForHost(serverHost); if (resolvedAddress != null) { harEntry.setServerIPAddress(resolvedAddress); } else { log.warn("Unable to find cached IP address for host: {}. IP address in HAR entry will be blank.", serverHost); } } else { log.warn("Unable to identify host from request uri: {}", httpRequest.getUri()); } }
@Override public void proxyToServerResolutionSucceeded(String serverHostAndPort, InetSocketAddress resolvedRemoteAddress) { long dnsResolutionFinishedNanos = System.nanoTime(); if (dnsResolutionStartedNanos > 0L) { harEntry.getTimings().setDns(dnsResolutionFinishedNanos - dnsResolutionStartedNanos, TimeUnit.NANOSECONDS); } else { harEntry.getTimings().setDns(0L, TimeUnit.NANOSECONDS); } // the address *should* always be resolved at this point InetAddress resolvedAddress = resolvedRemoteAddress.getAddress(); if (resolvedAddress != null) { addressResolved = true; harEntry.setServerIPAddress(resolvedAddress.getHostAddress()); } }
@Override public void proxyToServerResolutionSucceeded(String serverHostAndPort, InetSocketAddress resolvedRemoteAddress) { long dnsResolutionFinishedNanos = System.nanoTime(); if (dnsResolutionStartedNanos > 0L) { harEntry.getTimings().setDns(dnsResolutionFinishedNanos - dnsResolutionStartedNanos, TimeUnit.NANOSECONDS); } else { harEntry.getTimings().setDns(0L, TimeUnit.NANOSECONDS); } // the address *should* always be resolved at this point InetAddress resolvedAddress = resolvedRemoteAddress.getAddress(); if (resolvedAddress != null) { addressResolved = true; harEntry.setServerIPAddress(resolvedAddress.getHostAddress()); } }
/** * Populates the serverIpAddress field of the harEntry using the internal hostname->IP address cache. * * @param httpRequest HTTP request to take the hostname from */ protected void populateAddressFromCache(HttpRequest httpRequest) { String serverHost = getHost(httpRequest); if (serverHost != null && !serverHost.isEmpty()) { String resolvedAddress = ResolvedHostnameCacheFilter.getPreviouslyResolvedAddressForHost(serverHost); if (resolvedAddress != null) { harEntry.setServerIPAddress(resolvedAddress); } else { // the resolvedAddress may be null if the ResolvedHostnameCacheFilter has expired the entry (which is unlikely), // or in the far more common case that the proxy is using a chained proxy to connect to connect to the // remote host. since the chained proxy handles IP address resolution, the IP address in the HAR must be blank. log.trace("Unable to find cached IP address for host: {}. IP address in HAR entry will be blank.", serverHost); } } else { log.warn("Unable to identify host from request uri: {}", httpRequest.getUri()); } }
@Override public void proxyToServerResolutionSucceeded(String serverHostAndPort, InetSocketAddress resolvedRemoteAddress) { Log.e("Capture", "proxyToServerResolutionSucceeded " + harEntry.getId()); long dnsResolutionFinishedNanos = System.nanoTime(); if (dnsResolutionStartedNanos > 0L) { harEntry.getTimings().setDns(dnsResolutionFinishedNanos - dnsResolutionStartedNanos, TimeUnit.NANOSECONDS); } else { harEntry.getTimings().setDns(0L, TimeUnit.NANOSECONDS); } // the address *should* always be resolved at this point InetAddress resolvedAddress = resolvedRemoteAddress.getAddress(); if (resolvedAddress != null) { addressResolved = true; harEntry.setServerIPAddress(resolvedAddress.getHostAddress()); } }
/** * Populates the serverIpAddress field of the harEntry using the internal hostname->IP address cache. * * @param httpRequest HTTP request to take the hostname from */ protected void populateAddressFromCache(HttpRequest httpRequest) { Log.e("InnerHandle", "populateAddressFromCache " + harEntry.getId()); String serverHost = getHost(httpRequest); if (serverHost != null && !serverHost.isEmpty()) { String resolvedAddress = ResolvedHostnameCacheFilter.getPreviouslyResolvedAddressForHost(serverHost); if (resolvedAddress != null) { harEntry.setServerIPAddress(resolvedAddress); } else { // the resolvedAddress may be null if the ResolvedHostnameCacheFilter has expired the entry (which is unlikely), // or in the far more common case that the proxy is using a chained proxy to connect to connect to the // remote host. since the chained proxy handles IP address resolution, the IP address in the HAR must be blank. log.trace("Unable to find cached IP address for host: {}. IP address in HAR entry will be blank.", serverHost); } } else { log.warn("Unable to identify host from request uri: {}", httpRequest.getUri()); } }