Giter VIP home page Giter VIP logo

vmess-preresolver's Introduction

vmess dns pre-resolver

通过pythondns模块和指定的dns server,批量解析订阅链接里的域名并解析为本地的ip。

作用

如果您的机场无法连接,不妨检查一下它的域名是否被污染。如果它的域名遭到了污染,你的v2ray core就无法连接它了。

这个时候,不妨试一下修改链接的地址域名为他们的真实ip,这个时候你可能就发现可以正常连接了。

说明

不是很清楚V2ray对域名是怎么处理的,如果走系统解析的话,这可能会导致你的每个代理过去的proxy都会 有一个解析代理服务器域名的过程,如果域名解析速度有些缓慢,或本地使用了相对缓慢的dns(比如doh和dot等等)时可能会极大地降低网络速度和延迟,此时,优先解析域名为ip的作用就体现了出来。

正常的tls连接是需要域名这一关键信息的。因为没有ca会给一个没有域名的服务器颁发证书。但v2ray的tls handshake过程 应该是带有混淆的,因此正常情况下把域名改成ip地址理论上不会产生问题。

使用

下载你的订阅连接的全部响应到本地磁盘,保存为一个文件。然后调用python main.py xxx 1.1.1.1,订阅信息会自动被decode, 程序会取出里面所有的add为域名的记录,然后多线程解析域名。你传入的第二个参数是你希望使用的dns服务器。并覆盖原来的add字段。程序不会修改任何其他的参数。

程序会自动监测你的节点的add字段是否为域名,如果它已经是ip地址了,则程序不会做任何修改,会直接返回。

有效性

当你的节点被dns污染的时候,直接写hosts会来的更加迅速一些,所以这个程序并没有什么卵用。但是对于安卓手机等不方便修改hosts的设备,我认为它是一个不错的选择

协议

本项目遵守MIT开源协议,希望大家能协助开发。

vmess-preresolver's People

Contributors

neboer avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

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.