Giter Site home page Giter Site logo

bailiang9966 / wireguard_converted_nekoray Goto Github PK

View Code? Open in Web Editor NEW

This project forked from juerson/wireguard_converted_nekoray

0.0 0.0 0.0 1.85 MB

使用 Cloudfare WARP 密钥生成的 WireGuard 配置文件的参数,转换为 NekoBox 客户端的 "nekoray://" 或 "sn://" 分享链接,转换为 clash 配置文件。(p.s. 支持单个转换和批量转换,批量转换所用到的数据,支持 WARP 优选 IP 工具,输出的 result.csv 文件,也支持一行一个 "IP:PORT" 格式的 ip.txt 文件)

Python 100.00%

wireguard_converted_nekoray's Introduction

wireguard_converted_nekoray

该代码库主要用途:使用 Cloudfare WARP 密钥生成的 WireGuard 配置文件的参数,转换为 NekoBox 客户端的 nekoray://sn:// 分享链接、转换为 Clash 配置文件。

1、单个转换:按照程序傻瓜式操作,输入 WARP 的优选 IP ,生成对应的 nekoray://sn:// 分享链接(生成的链接,已经复制到剪切板)。

2、批量转换:支持 ip.txt 文件(每行一个 IP:PORT 格式的 WARP 优选 IP )、result.csv 文件的数据输入,批量转换。

  • 生成对应的 nekoray://sn://分享链接,输出到 output-node.txt 文件中。

  • 转换为 clash 配置文件,使用最简单的方法,字符串替换大法,将 配置文件/clash.yaml模板中,需要替换的字符替换掉,模板文件中的内容均来自 subconverter v0.9.0 程序转换而来的,没有任何删改,除了添加 dns 相关的字段外。

一、使用注意

1、建议使用前,将 配置文件/wg-config.conf 文件中的参数,改为自己的。

2、Reserved 参数的值,我暂时没有发现有什么作用,添加和不添加 Reserved 值都能使用。

3、想填写 Reserved 参数的值,不知道这个 Reserved 值怎么来的?之前听说过数组类型的 Reserve(例如:[173,177,149]),但是又听说 Android 版的 NekoBoxReserved 只支持字符串类型的 Reserve (4个字符)?该怎么获取字符串类型的 Reserve ?网上找了一下,这个视频可能能解答你的问题,介绍了如何将数组类型的 Reserved 转换为字符串类型的 Reserved附:转换平台)。

4、WireGuard 的 SN Link 生成,根据这里的代码修改,目前发现 SN Link 的配置名称不能使用中文、某些特殊字符,一些国家的语言可能也不支持,应该缺少某些功能,但是能使用,编译的 EXE 程序,就不留出可以自定义配置名称的功能。

5、MTU 值修改,参考资料:link

6、转换为 Clash 配置文件的,代码中没有使用到 Reserved 值。使用过程出现问题且有精力可以排查一下:账号问题(换成自己的 WARP Plus)、MTU值问题、配置文件/clash.yaml 文件中的 dns 字段值的问题、优选的 IP 问题、Clash 客户端问题(包括 Clash 内核问题),也可能是下面这块代码出问题,特别是dns解析与其它的dns冲突(网速慢的情况,可能跟它有关),可以将 remote-dns-resolvedns字段删除。

点击展开代码
{
  "name": "warp-001",
  "type": "wireguard",
  "server": "162.159.192.1",
  "port": 2408,
  "ip": "172.16.0.2",
  "ipv6": "",
  "private-key": "",
  "public-key": "bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo=",
  "pre-shared-key": "",
  "reserved": "",
  "udp": true,
  "mtu": 1280,
  "remote-dns-resolve": true,
  "dns": [
    "1.1.1.1",
    "1.0.0.1",
    "2606:4700:4700::1111",
    "2606:4700:4700::1001"
  ]
}

二、相关截图

注意:有线宽带或光纤、无线 WiFi 没有公网 IPv6 地址的,无法跑出 IPv6 的 result.csv 文件,不管您从网上哪里弄来 reult.csv 文件(包括这个代码库),没有 IPv6 的地址,是使用不了的,除非套一层 IPv6 的代理。本代码中的 IPv6 UDP 延迟测试,是基于 Cloudflare WARP 提供的 IPv6 地址测试出来的。

支持其他服务商提供的 WireGuard 配置文件,由于没有大量、不同服务商提供的 WireGuard 配置文件作为数据测试,不保证所有WireGuard 配置文件都能转为nekoray://sn:// 链接使用,建议自己测试。目前我只知道,需要如图中 PrivateKeyAddress PublicKeyEndpoint 这四个参数值,就能转换/生成 nekoray://sn:// 的分享链接。

三、使用到的工具:

wireguard_converted_nekoray's People

Contributors

juerson 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.