标签:情况 web head eve epo github soft and tps
关于 ANDROID 5.0-7.1.2 网络图标上的感叹号及其解决办法-狐狸的小小窝
HTTP状态码之204 No Content
原理:
访问generate_204地址,如果得到状态码是204则网络畅通。
如果不是,则需要认为需要登录
但是以下测试让我有点懵逼
在未登录的情况下,我们访问generate_204地址试试,如:
C:\WINDOWS\system32>curl http://edge.microsoft.com/captiveportal/generate_204
<html>
<head>
<meta http-equiv="Cache-Control" contect="no-cache">
<meta http-equiv="Pragma" contect="no-cache">
<meta http-equiv="Expires" contect="0">
<script type="text/javascript">
location.replace("http://这里是WIFI登录地址");
</script></head><body>
</body></html>
C:\WINDOWS\system32>
发现可以直接得到跳转的地址(即WIFI Portal登录地址)
关于函数location.replace() 见: https://developer.mozilla.org/zh-CN/docs/Web/API/Location/replace
而登录WIFI之后,再访问204地址则是得到空内容
C:\WINDOWS\system32>curl http://edge.microsoft.com/captiveportal/generate_204
C:\WINDOWS\system32>
可用的204地址有:
http://connect.rom.miui.com/generate_204
http://connectivitycheck.platform.hicloud.com/generate_204
http://edge.microsoft.com/captiveportal/generate_204
可能有用的资料:
https://gmd20.github.io/blog/Wifi热点强制登录认证页面captive portal相关资料
所以有没有人告诉我为什么访问204地址能得到登录地址呢?
标签:情况 web head eve epo github soft and tps
原文地址:https://www.cnblogs.com/yucloud/p/12072599.html