aliyun / alicloud-android-demo

992 stars 552 forks source link

你好,我想知道为什么webview.loadUrl(url,additionalHttpHeaders)这种方式不能达到ip直连的效果 #230

Open CPT-CJS opened 4 years ago

CPT-CJS commented 4 years ago

代码如下 Map<String, String> extraHeaders = new HashMap<String, String>(); extraHeaders.put("Referer", ""); extraHeaders.put("Host", host); String ip = HttpDNS.getIpByHostAsync(host); if (!TextUtils.isEmpty(ip)) { String newUrl = StringRegular.urlWithIp(currentUrl, ip); view.loadUrl(newUrl, extraHeaders); }

跟了一波webview源码没找到原因,功力不够,求解