Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
CPT-CJS opened this issue Apr 8, 2020 · 0 comments

Comments

@CPT-CJS
Copy link

CPT-CJS commented Apr 8, 2020

代码如下
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源码没找到原因,功力不够,求解

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant