Giter Site home page Giter Site logo

Comments (11)

cyfdecyf avatar cyfdecyf commented on July 23, 2024

blocked 里添加 google.com 就相当于 *.google.com。

google.com 有的子域名是抽风(想到写 COW 就是因为这个),有的是彻底被墙,所以我只是把 plus.google.com 加入到内置的被墙列表里。

不支持正则和星号,在查询一个 host 是否是用户指定时只需要查 host 和域名是否出现在一个 map 中即可(相关代码在 sitestat.go 中)。如果支持正则表达式,我目前能想到的办法是 host 跟每个正则表达式去匹配。

COW 的目的是为了让翻墙自动化,理想的情况是不需要 direct/blocked 这两个文件。而且 COW 目前的工作方式下我觉得正则表达式和星号匹配不是特别必要。

direct/blocked (包括 stat) 大多数情况下只是作为优化访问速度而存在的。direct 是为了让浏览器直连某些网站;blocked 是为了让被墙网站直接用二级代理,避免检测被墙花费的时间。目前一个 host 直接访问失败后 2 分钟内会总是使用二级代理,遇到 10 次这种情况后就直接使用二级代理。(有一定概率会直连,避免误判被墙。)

现在我遇到的一些问题是 google search 有时会需要等很长时间才能打开,可能是重试机制里有些问题。

from cow.

tevino avatar tevino commented on July 23, 2024

我遇到的问题和你一样,如果google.com相当于*.google.com那问题就不出在匹配的这部分了

from cow.

cyfdecyf avatar cyfdecyf commented on July 23, 2024

你是把 google.com 加入到 blocked 里也遇到了这样的问题么?

from cow.

tevino avatar tevino commented on July 23, 2024

没错

from cow.

cyfdecyf avatar cyfdecyf commented on July 23, 2024

那应该就不是重试请求的代码有问题了。目前 log 文件里只有创建 shadowsocks 连接出错才记 log,刚修改代码让所有 parent proxy 连接出错都记 error log。

from cow.

tevino avatar tevino commented on July 23, 2024

ff427c3报Config error: no such option "httpUserPasswd"

from cow.

cyfdecyf avatar cyfdecyf commented on July 23, 2024

ff427c3 这个 commit 还没有 merge 你的代码。最新的 develop branch 不会报错。

from cow.

tevino avatar tevino commented on July 23, 2024

刚刚看的是自己的fork,pull到e3764de没有报错了,不过访问google也没有错误日志,只是慢。

from cow.

glacjay avatar glacjay commented on July 23, 2024

真想实现正则表达式的话,可以参考词法分析,就是把一砣正则编译成一个状态机来实现匹配。虽然这功能我是用不着啦。

from cow.

cyfdecyf avatar cyfdecyf commented on July 23, 2024

@glacjay 嗯,直接把所有的表达式用或操作合并起来,compile 一次也可以。但 sitestat.go 中的代码也需要改成用正则表达式匹配。

加入这个功能其实就变成鼓励人去关心这两个文件,跟你以前提的建议也不符合。

from cow.

glacjay avatar glacjay commented on July 23, 2024

@cyfdecyf 嗯,所以这个只是纯技术讨论。

from cow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.