From 95c5410f00e018d025e3aa7cb5797dedab0395e2 Mon Sep 17 00:00:00 2001 From: James Feng Cao Date: Fri, 7 Apr 2023 15:32:34 +0800 Subject: [PATCH] hosts to support both ip address and response headers --- en/_posts/index.xml | 4 ++-- en/adblock_domain/index.html | 24 ++++++++++++++---------- en/index.xml | 4 ++-- en/sitemap.xml | 10 +++++----- en/tags/adblock/index.xml | 4 ++-- sitemap.xml | 2 +- 6 files changed, 26 insertions(+), 22 deletions(-) diff --git a/en/_posts/index.xml b/en/_posts/index.xml index b7242405..95f32380 100644 --- a/en/_posts/index.xml +++ b/en/_posts/index.xml @@ -48,8 +48,8 @@ Long pressing the bookmark button in uweb browser will popup menus defined in fi /en/adblock_domain/ The enhanced hosts files "hosts" and "default.hosts" take effect when the setting option "using hosts" is checked. The enhanced file "hosts" defines IP addresses/attributes for domains. Each line has the following format: -[IP address/attributes][single space][domain name] -where "[IP address/attributes]" could be: +[[IP address][attributes]][single space][domain name] +where "[[IP address][attributes]]" could be: ipv4 address such as: 172.67.157.211 torapp.eu.org ipv6 address, Ex.: diff --git a/en/adblock_domain/index.html b/en/adblock_domain/index.html index 68c58ee1..4e008051 100644 --- a/en/adblock_domain/index.html +++ b/en/adblock_domain/index.html @@ -51,8 +51,8 @@

The enhanced hosts files "hosts" and "default.hosts" take effect when the setting option "using hosts" is checked.

The enhanced file "hosts" defines IP addresses/attributes for domains. Each line has the following format:
-[IP address/attributes][single space][domain name]

-

where "[IP address/attributes]" could be:

+[[IP address][attributes]][single space][domain name]

+

where "[[IP address][attributes]]" could be:

which will make all git repositories on the domain visitable as websites with raw file access url.

- + +
  • +

    response headers, separeded by ';', Ex.:
    +Access-Control-Allow-Origin;*;Access-Control-Allow-Credentials;true mybing2.xn--xyza.top

    which makes "mybing2.xn--xyza.top" to accept CORS requests with cookies.

    +
  • +
  • +

    IP address and response headers, separeded by ';', Ex.:
    +172.64.80.1;Access-Control-Allow-Origin;https://www.bing.com;Access-Control-Allow-Credentials;true wild-cake-ff77.jamesfengcao.workers.dev

    +
  • +

    "default.hosts" blocks whole domain trees including all descedant domains. The domains in the hosts file must be 2 or 3 segment domains, such as "yahoo.com" and "finance.yahoo.com". If the length of the last 2 segments is less than 7, such as "com.pl", then it is treated as one segment, so domains like "xxx.xxx.com.pl" are also valid in the hosts file.

    Each line of the hosts file has the following format:
    [rootDomain][space][regex for domain prefix before rootDomain][space][regex for the whole url without "http(s)://"]
    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.

    -

    Last Modified: 3 April 2023
    -bingAI to support cors with cookies
    +

    Last Modified: 7 April 2023
    +hosts to support both ip address and response headers

    
     

    diff --git a/en/index.xml b/en/index.xml index d6ff861c..00956e67 100644 --- a/en/index.xml +++ b/en/index.xml @@ -48,8 +48,8 @@ Long pressing the bookmark button in uweb browser will popup menus defined in fi /en/adblock_domain/ The enhanced hosts files "hosts" and "default.hosts" take effect when the setting option "using hosts" is checked. The enhanced file "hosts" defines IP addresses/attributes for domains. Each line has the following format: -[IP address/attributes][single space][domain name] -where "[IP address/attributes]" could be: +[[IP address][attributes]][single space][domain name] +where "[[IP address][attributes]]" could be: ipv4 address such as: 172.67.157.211 torapp.eu.org ipv6 address, Ex.: diff --git a/en/sitemap.xml b/en/sitemap.xml index 43de4005..769370d3 100644 --- a/en/sitemap.xml +++ b/en/sitemap.xml @@ -3,7 +3,7 @@ xmlns:xhtml="http://www.w3.org/1999/xhtml"> /en/_posts/ - 2023-04-03T17:48:42+08:00 + 2023-04-07T15:29:47+08:00 /en/ - 2023-04-03T17:49:38+08:00 + 2023-04-07T15:29:47+08:00 /en/tags/adblock/ - 2023-04-03T17:48:42+08:00 + 2023-04-07T15:29:47+08:00 /en/adblock_domain/ - 2023-04-03T17:48:42+08:00 + 2023-04-07T15:29:47+08:00 /en/tags/ - 2023-04-03T17:48:42+08:00 + 2023-04-07T15:29:47+08:00 /en/adblock_domain/ The enhanced hosts files "hosts" and "default.hosts" take effect when the setting option "using hosts" is checked. The enhanced file "hosts" defines IP addresses/attributes for domains. Each line has the following format: -[IP address/attributes][single space][domain name] -where "[IP address/attributes]" could be: +[[IP address][attributes]][single space][domain name] +where "[[IP address][attributes]]" could be: ipv4 address such as: 172.67.157.211 torapp.eu.org ipv6 address, Ex.: diff --git a/sitemap.xml b/sitemap.xml index 24b9f4d0..17b22001 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -4,7 +4,7 @@ en/sitemap.xml - 2023-04-03T17:49:38+08:00 + 2023-04-07T15:29:47+08:00