uweb/en/adblock_domain/index.html

123 lines
4.8 KiB
HTML
Raw Normal View History

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
2023-12-11 08:23:07 +01:00
2024-04-01 15:51:55 +02:00
<link rel="stylesheet" href="../style.css#" type="text/css" />
2023-03-20 15:31:36 +01:00
<title>Hosts files</title>
<script type="text/javascript">
function findLang(){
let href = location.href;
for(let i=href.length-1;i>0;i--){
if('/'==href.charAt(i) && '/'==href.charAt(i-3))
return i;
}
return 0;
}
function nav2(page){
let i = findLang();
location.href = location.href.substring(0,i+1)+page;
}
function nav2Lang(lang){
let i = findLang();
let href = location.href;
location.href = location.href.substring(0,i-2)+lang+location.href.substring(i);
}
</script>
</head>
<body>
<header class='header'>
2024-04-02 07:42:43 +02:00
<a class="logo" href="javascript:void(0)" onclick="return nav2('index.html#')">Home</a> <a class="logo" href="javascript:void(0)" onclick="return nav2('tags/index.html#')">Tags</a>
<a class="logo" href="javascript:void(0)" onclick="return nav2Lang('zh')">简体中文</a>
<nav>
</nav>
</header>
<br />
<div class="container">
2023-03-20 15:31:36 +01:00
<h1 class="title">Hosts files
<br>
<span class="subtitle"></span>
</h1>
<ul class="tags">
2024-04-01 15:51:55 +02:00
<li><a href="../tags/adblock/index.html#">adblock</a> </li>
</ul>
2023-05-13 14:12:55 +02:00
<p>The enhanced hosts files &quot;hosts&quot; and &quot;default.hosts&quot; take effect with the setting option &quot;use hosts&quot;.</p>
2023-04-13 05:13:46 +02:00
<h4 id="hosts">hosts</h4>
<p>The <span style="color:red">enhanced</span> file <a href="file:///data/data/info.torapp.uweb/files/hosts">&quot;hosts&quot;</a> defines IP addresses/attributes for domains. Each line has the following format:<br>
[[IP address][attributes]][single space][domain name]</p>
<p>where &quot;[[IP address][attributes]]&quot; could be:</p>
<ul>
<li>
<p>ipv4 address such as:<br>
2023-04-01 09:15:10 +02:00
172.67.157.211 torapp.eu.org</p>
</li>
<li>
<p>ipv6 address, Ex.:<br>
2023-04-01 09:15:10 +02:00
[2606:4700:3037::6815:8c3] torapp.eu.org</p>
</li>
<li>
<p>empty, that would lift all server-imposed limitations. Ex.:<br>
[single space]gitee.com</p>
2023-04-03 03:13:07 +02:00
<p>which will make all git repositories on the domain visitable as websites with raw file access url.</p>
</li>
<li>
<p>response headers, separeded by ';', Ex.:<br>
2023-04-07 12:07:09 +02:00
Access-Control-Allow-Origin;https://www.bing.com;Access-Control-Allow-Credentials;true mybing.xn--xyza.top</p>
2023-04-03 11:51:28 +02:00
<p>which makes &quot;mybing2.xn--xyza.top&quot; to accept CORS requests with cookies.</p>
</li>
<li>
<p>IP address and response headers, separeded by ';', Ex.:<br>
2023-04-07 12:07:09 +02:00
104.21.8.195;Access-Control-Allow-Origin;https://www.bing.com;Access-Control-Allow-Credentials;true uweb.torapp.eu.org</p>
</li>
2023-04-13 05:13:46 +02:00
<li>
<p>IP address, real domain name and response headers (Experimental), separeded by ';', Ex.:<br>
104.21.8.195;www.bing.com uweb.torapp.eu.org</p>
<p>which indicates the domain &quot;uweb.torapp.eu.org&quot; is just a proxy of &quot;www.bing.com&quot;, and as such, the cookies of &quot;www.bing.com&quot; would be used for &quot;uweb.torapp.eu.org&quot;.</p>
<p>To make life easier, use lower-case domain name (the first letter should not be a digital) and capitalize the first letter of response header names.</p>
</li>
</ul>
2023-04-13 05:13:46 +02:00
<h4 id="defaulthosts">default.hosts</h4>
2023-04-10 02:23:51 +02:00
<p><a href="file:///data/data/info.torapp.uweb/files/default.hosts">&quot;default.hosts&quot;</a> blocks whole domain trees including all descendant domains. The domains in the hosts file must be 2 or 3 segment domains, such as &quot;yahoo.com&quot; and &quot;finance.yahoo.com&quot;. If the length of the last 2 segments is less than 7, such as &quot;com.pl&quot;, then it is treated as one segment, so domains like &quot;xxx.xxx.com.pl&quot; are also valid in the hosts file.</p>
<p>Each line of the hosts file has the following format:<br>
[rootDomain][space][regex for domain prefix before rootDomain][space][regex for the whole url without &quot;http(s)://&quot;]<br>
The first part [rootDomain] is required and the others are optional. regex is java-grammar regular expression. If the second regex is used, it is recommended to merge the first regex to the second one for performance.</p>
</div>
2024-04-02 07:42:43 +02:00
<p>Last Modified: 2 April 2024<br>
2023-05-19 09:09:14 +02:00
update bingAI/js/optionsSets.js<br>
2023-03-07 03:07:05 +01:00
<pre></pre>
</p>
2024-03-21 02:04:37 +01:00
2023-05-06 03:56:44 +02:00
<script id='jsgiscus'
src='https://giscus.app/client.js'
data-repo="torappinfo/uweb"
data-repo-id="MDEwOlJlcG9zaXRvcnkzMDIyMDU3MjE="
data-category="Announcements"
data-category-id="DIC_kwDOEgNLGc4CQjsh"
2023-05-06 04:49:29 +02:00
data-mapping="title"
2023-05-06 03:56:44 +02:00
data-strict="0"
data-reactions-enabled="1"
data-emit-metadata="0"
data-input-position="top"
data-theme="light"
data-lang="en"
data-loading="lazy"
2023-05-06 04:49:29 +02:00
crossorigin="anonymous" async>
2023-05-06 03:40:28 +02:00
</script>
2024-04-03 03:47:35 +02:00
<footer class="site-footer">
<div class="container">
&copy; 2024 Richard H. Cao
</div>
</footer>
</body>
</html>