diff --git a/.github/workflows/update-pkgbuild.yml b/.github/workflows/update-pkgbuild.yml deleted file mode 100644 index c2a59b3..0000000 --- a/.github/workflows/update-pkgbuild.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: AUR CI -on: - push: - branches: - - main - paths-ignore: - - '**.md' - - 'LICENSE' - - '!.github/workflows/**' - -jobs: - update: - runs-on: ubuntu-latest - steps: - - uses: chitang233/aur-pkgbuild-builder@main - with: - deploy_key: ${{ secrets.DEPLOY_KEY }} - package_name: 'nekoray-git' diff --git a/.gitmodules b/.gitmodules index 971caf6..72a74b8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ [submodule "3rdparty/QHotkey"] path = 3rdparty/QHotkey url = https://github.com/Skycoder42/QHotkey.git -[submodule "3rdparty/qjs"] - path = 3rdparty/qjs - url = https://github.com/MatsuriDayo/qjs diff --git a/3rdparty/qjs b/3rdparty/qjs deleted file mode 160000 index 3fb0770..0000000 --- a/3rdparty/qjs +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3fb0770c9ee5ab031a56072520641d4577b694e3 diff --git a/CMakeLists.txt b/CMakeLists.txt index eeb6ac4..b619976 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,9 +30,7 @@ if (NKR_CROSS) endif () #### Platform Variables #### -if (APPLE) - include("cmake/macos/macos.cmake") -elseif (WIN32) +if (WIN32) include("cmake/windows/windows.cmake") else () include("cmake/linux/linux.cmake") @@ -65,10 +63,6 @@ include("cmake/nkr.cmake") find_package(Threads) -if (NKR_PACKAGE OR NKR_PACKAGE_MACOS) - nkr_add_compile_definitions(NKR_CPP_USE_APPDATA) -endif () - #### NKR EXTERNAL #### if (NKR_NO_EXTERNAL) @@ -76,15 +70,6 @@ if (NKR_NO_EXTERNAL) set(NKR_NO_YAML 1) set(NKR_NO_ZXING 1) set(NKR_NO_QHOTKEY 1) - set(NKR_NO_QUICKJS 1) -endif () - -# quickjs (static submodule) -if (NKR_NO_QUICKJS) - nkr_add_compile_definitions(NKR_NO_QUICKJS) -else () - add_subdirectory(3rdparty/qjs) - list(APPEND NKR_EXTERNAL_TARGETS quickjs) endif () # grpc @@ -140,7 +125,6 @@ set(PROJECT_SOURCES main/main.cpp main/NekoGui.cpp main/NekoGui_Utils.cpp - main/QJS.cpp main/HTTPRequestHelper.cpp 3rdparty/base64.cpp @@ -287,21 +271,6 @@ set_property(TARGET nekoray PROPERTY AUTOUIC ON) set_property(TARGET nekoray PROPERTY AUTOMOC ON) set_property(TARGET nekoray PROPERTY AUTORCC ON) -# Target Source macOS - -set(MACOSX_ICON ${CMAKE_SOURCE_DIR}/res/nekoray.icns) -if (APPLE) - target_sources(nekoray PRIVATE ${MACOSX_ICON}) -endif () -set_target_properties(nekoray PROPERTIES - MACOSX_BUNDLE_ICON_FILE "nekoray.icns" - RESOURCE ${MACOSX_ICON} - MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/res/MacOSXBundleInfo.plist - MACOSX_BUNDLE_GUI_IDENTIFIER moe.nekoray.macosx - MACOSX_BUNDLE TRUE - WIN32_EXECUTABLE TRUE -) - # Target Source Translations set(TS_FILES diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index c70133d..0000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,128 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, religion, or sexual identity -and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the - overall community - -## Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or - advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email - address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -. -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series -of actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or -permanent ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within -the community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.0, available at -https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. - -Community Impact Guidelines were inspired by [Mozilla's code of conduct -enforcement ladder](https://github.com/mozilla/diversity). - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see the FAQ at -https://www.contributor-covenant.org/faq. Translations are available at -https://www.contributor-covenant.org/translations. diff --git a/README.md b/README.md index 04c9f9e..64e2dab 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,22 @@ -# NekoRay / NekoBox For PC +# NekoBox For PC -Qt based cross-platform GUI proxy configuration manager (backend: v2ray / sing-box) +Qt based cross-platform GUI proxy configuration manager (backend: sing-box) Support Windows / Linux out of the box now. -基于 Qt 的跨平台代理配置管理器 (后端 v2ray / sing-box) +基于 Qt 的跨平台代理配置管理器 (后端 sing-box) 目前支持 Windows / Linux 开箱即用 -## Readme Translations +## 4.x 开发计划 -中文 / English / [fa_IR](README_fa.md) / [日本語](README_ja.md) / [Русский](README_ru.md) +软件定位:电脑端节点调试软件。更新频率随机,可用性无保证。机场订阅用户建议使用 Clash Verge Rev 等。 + +1. 移除 Xray 核心,更新 sing-box。 +2. 移除一些没用的功能。 +3. 更新文档。 +4. 更新部分依赖 +5. 移除 macos 遗留 ## 下载 / Download @@ -29,7 +35,7 @@ Support Windows / Linux out of the box now. #### AUR - [nekoray](https://aur.archlinux.org/packages/nekoray) -- [nekoray-git](https://aur.archlinux.org/packages/nekoray-git) [![AUR CI](https://github.com/MatsuriDayo/nekoray/actions/workflows/update-pkgbuild.yml/badge.svg)](https://github.com/MatsuriDayo/nekoray/actions/workflows/update-pkgbuild.yaml) +- [nekoray-git](https://aur.archlinux.org/packages/nekoray-git) #### archlinuxcn @@ -81,14 +87,6 @@ https://matsuridayo.github.io [Linux 运行教程](docs/Run_Linux.md) -## macOS - -由于缺乏维护,不再提供 macOS 版本下载。 - -您还可以在下面的存储库中非正式地获取更新版本。[非官方发布 / Unofficial releases](https://github.com/aaaamirabbas/nekoray-macos/releases) - -仍可以参照下方教程自行编译,常见问题请参考历史 Issue,欢迎 Pull Request 修复。 - ## 编译教程 / Compile Tutorial 请看 [技术文档 / Technical documentation](https://github.com/MatsuriDayo/nekoray/tree/main/docs) @@ -116,8 +114,8 @@ Core: - [v2fly/v2ray-core](https://github.com/v2fly/v2ray-core) ( < 3.10 ) - [MatsuriDayo/Matsuri](https://github.com/MatsuriDayo/Matsuri) ( < 3.10 ) - [MatsuriDayo/v2ray-core](https://github.com/MatsuriDayo/v2ray-core) ( < 3.10 ) -- [XTLS/Xray-core](https://github.com/XTLS/Xray-core) ( >= 3.10 ) -- [MatsuriDayo/Xray-core](https://github.com/MatsuriDayo/Xray-core) ( >= 3.10 ) +- [XTLS/Xray-core](https://github.com/XTLS/Xray-core) ( 3.10 <= Version <= 3.26 ) +- [MatsuriDayo/Xray-core](https://github.com/MatsuriDayo/Xray-core) ( 3.10 <= Version <= 3.26 ) - [SagerNet/sing-box](https://github.com/SagerNet/sing-box) - [Matsuridayo/sing-box-extra](https://github.com/MatsuriDayo/sing-box-extra) diff --git a/README_fa.md b/README_fa.md deleted file mode 100644 index cf3b1cd..0000000 --- a/README_fa.md +++ /dev/null @@ -1,95 +0,0 @@ -# NekoRay - -مدیریت پیکربندی پروکسی با رابط کاربری مبتنی بر QT , کراس پلتفرم . (بک اند : v2ray / sing-box ) - -اکنون از Windows / Linux / macOS amd64 پشتیبانی می کند. - -## دانلود / Download - -### GitHub Releases (Portable ZIP) - -فرمت قابل حمل، بدون نصب. برای دانلود باینری های از پیش کامپایل شده به Releases بروید، آنها را باز کرده و از آنها استفاده کنید. - -[![GitHub All Releases](https://img.shields.io/github/downloads/Matsuridayo/nekoray/total?label=downloads-total&logo=github&style=flat-square)](https://github.com/Matsuridayo/nekoray/releases) - -[Download](https://github.com/Matsuridayo/nekoray/releases) - -### بسته - -1. AUR [nekoray-git](https://aur.archlinux.org/packages/nekoray-git) [![AUR CI](https://github.com/MatsuriDayo/nekoray/actions/workflows/update-pkgbuild.yml/badge.svg)](https://github.com/MatsuriDayo/nekoray/actions/workflows/update-pkgbuild.yaml) -2. Scoop Extras: `scoop install nekoray` -3. Homebrew (unoffical): [homebrew-nekoray](https://github.com/tdjnodj/homebrew-nekoray) -4. APT (unoffical): [tdjnodj/apt](https://github.com/tdjnodj/apt) - -## تغییرات برنامه و کانال تلگرام / Changelog & Telegram Channel - -https://t.me/Matsuridayo - -## صفحه مستندات / Homepage & Documents - -https://matsuridayo.github.io - -## پروکسی / Proxy - -- SOCKS (4/4a/5) -- HTTP(S) -- Shadowsocks -- VMess -- VLESS -- Trojan -- NaïveProxy ( Custom Core ) -- Hysteria ( Custom Core or sing-box ) -- Hysteria2 ( Custom Core or sing-box ) -- Custom Outbound -- Custom Core - -## اشتراک / Subscription - -- فرمت های خام: برخی از فرمت های پرکاربرد (مانند Shadowsocks، Clash و v2rayN) - -## پارامترهای عملیاتی - -- `-many` نمونه در حال اجرا همان دایرکتوری را نادیده بگیرید و به اجبار یک نمونه جدید راه اندازی کنید(0.11+) -- `-appdata` پس از باز کردن، فایل پیکربندی در دایرکتوری مشترک قرار می گیرد و نمی توان آن را بیشتر باز کرد و به طور خودکار ارتقا داد. (0.11+) - -## Windows - -اگر به شما می گوید که DLL وجود ندارد و نمی تواند اجرا شود، لطفاً [Microsoft C++ Runtime Library] (https://aka.ms/vs/17/release/vc_redist.x64.exe) را دانلود و نصب کنید. - -## Linux - -[آموزش اجرای لینوکس](docs/Run_Linux.md) - -## آموزش کامپایل - -[Linux](docs/Build_Linux_fa.md) - -[Windows](docs/Build_Windows.md) - -[macOs](docs/Build_MacOS_fa.md) - -## کمک مالی / Donate - -از کمک های مالی برای حمایت از توسعه پروژه استقبال می شود。 - -USDT TRC20 - -`TRhnA7SXE5Sap5gSG3ijxRmdYFiD4KRhPs` - -XMR - -`49bwESYQjoRL3xmvTcjZKHEKaiGywjLYVQJMUv79bXonGiyDCs8AzE3KiGW2ytTybBCpWJUvov8SjZZEGg66a4e59GXa6k5` - -## Credits - -- [v2fly/v2ray-core](https://github.com/v2fly/v2ray-core) -- [MatsuriDayo/Matsuri](https://github.com/MatsuriDayo/Matsuri) -- [MatsuriDayo/v2ray-core](https://github.com/MatsuriDayo/v2ray-core) -- [SagerNet/sing-box](https://github.com/SagerNet/sing-box) -- [Qv2ray](https://github.com/Qv2ray/Qv2ray) -- [Qt](https://www.qt.io/) -- [protobuf](https://github.com/protocolbuffers/protobuf) -- [yaml-cpp](https://github.com/jbeder/yaml-cpp) -- [zxing-cpp](https://github.com/nu-book/zxing-cpp) -- [QHotkey](https://github.com/Skycoder42/QHotkey) -- [AppImageKit](https://github.com/AppImage/AppImageKit) diff --git a/README_ja.md b/README_ja.md deleted file mode 100644 index 0172ba9..0000000 --- a/README_ja.md +++ /dev/null @@ -1,123 +0,0 @@ -# NekoRay / PC 用 NekoBox - -QtベースのクロスプラットフォームGUIプロキシ設定マネージャ (バックエンド:v2ray / sing-box) - -Windows / Linuxに対応。 - -## ダウンロード - -### GitHub Releases (Portable ZIP) - -Portable 形式、インストーラーなし。Releases からコンパイル済みバイナリをダウンロードし、解凍してお使いください。 - -[![GitHub All Releases](https://img.shields.io/github/downloads/Matsuridayo/nekoray/total?label=downloads-total&logo=github&style=flat-square)](https://github.com/Matsuridayo/nekoray/releases) - -[ダウンロード](https://github.com/Matsuridayo/nekoray/releases) - -[ダウンロードするパッケージがわからない場合のインストール方法](https://github.com/MatsuriDayo/nekoray/wiki/Installation-package-description) - -### Package - -#### AUR - -- [nekoray](https://aur.archlinux.org/packages/nekoray) -- [nekoray-git](https://aur.archlinux.org/packages/nekoray-git) [![AUR CI](https://github.com/MatsuriDayo/nekoray/actions/workflows/update-pkgbuild.yml/badge.svg)](https://github.com/MatsuriDayo/nekoray/actions/workflows/update-pkgbuild.yaml) - -#### archlinuxcn - -- [nekoray](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/nekoray) -- [nekoray-git](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/nekoray-git) - -#### Scoop Extras - -`scoop install nekoray` - -## Changelog と Telegram チャンネル - -https://t.me/Matsuridayo - -## ホームページとドキュメント - -https://matsuridayo.github.io - -## プロキシ - -- SOCKS (4/4a/5) -- HTTP(S) -- Shadowsocks -- VMess -- VLESS -- Trojan -- TUIC ( sing-box ) -- NaïveProxy ( Custom Core ) -- Hysteria ( Custom Core or sing-box ) -- Hysteria2 ( Custom Core or sing-box ) -- Custom Outbound -- Custom Config -- Custom Core - -## サブスクリプション - -- Raw: 広く使われているいくつかのフォーマット (Shadowsocks、Clash、v2rayN など) - -## 動作パラメーター - -[動作パラメーター](docs/RunFlags.md) - -## Windows 実行 - -DLL が見つからない場合は、[Microsoft C++ ランタイムライブラリ](https://aka.ms/vs/17/release/vc_redist.x64.exe)をダウンロードしてインストールしてください - -## Linux 実行 - -[Linux 実行チュートリアル](docs/Run_Linux.md) - -## macOS - -メンテナンス不足のため、macOS 版はダウンロードできなくなりました。 - -また、以下のリポジトリで非公式に更新版を入手することもできる。[非公式リリース](https://github.com/aaaamirabbas/nekoray-macos/releases) - -以下のチュートリアルを参考に、自分でコンパイルすることもできます。FAQ については歴史的な Issue を参照し、修正については Pull Request を歓迎します。 - -## コンパイルチュートリアル - -[技術ドキュメント](https://github.com/MatsuriDayo/nekoray/tree/main/docs)を参照して下さい - -## 寄付 - -このプロジェクトがあなたのお役に立つのであれば、寄付をすることでプロジェクトの継続を支援することができます。 - -50US ドル以上の寄付をされた方は、[寄付リスト](https://mtrdnt.pages.dev/donation_list)にアバターを表示することができます。ここに追加されていない場合は、ご連絡ください。 - -USDT TRC20 - -`TRhnA7SXE5Sap5gSG3ijxRmdYFiD4KRhPs` - -XMR - -`49bwESYQjoRL3xmvTcjZKHEKaiGywjLYVQJMUv79bXonGiyDCs8AzE3KiGW2ytTybBCpWJUvov8SjZZEGg66a4e59GXa6k5` - -- また、[Google Play](https://play.google.com/store/apps/details?id=moe.nb4a) からも寄付金を購入することができます。アリペイと WeChat の購入オプションもありますので、TG チャンネルのトップをご覧ください。 - -## クレジット - -Core: - -- [v2fly/v2ray-core](https://github.com/v2fly/v2ray-core) ( < 3.10 ) -- [MatsuriDayo/Matsuri](https://github.com/MatsuriDayo/Matsuri) ( < 3.10 ) -- [MatsuriDayo/v2ray-core](https://github.com/MatsuriDayo/v2ray-core) ( < 3.10 ) -- [XTLS/Xray-core](https://github.com/XTLS/Xray-core) ( >= 3.10 ) -- [MatsuriDayo/Xray-core](https://github.com/MatsuriDayo/Xray-core) ( >= 3.10 ) -- [SagerNet/sing-box](https://github.com/SagerNet/sing-box) -- [Matsuridayo/sing-box-extra](https://github.com/MatsuriDayo/sing-box-extra) - -Gui: - -- [Qv2ray](https://github.com/Qv2ray/Qv2ray) -- [Qt](https://www.qt.io/) -- [protobuf](https://github.com/protocolbuffers/protobuf) -- [yaml-cpp](https://github.com/jbeder/yaml-cpp) -- [zxing-cpp](https://github.com/nu-book/zxing-cpp) -- [QHotkey](https://github.com/Skycoder42/QHotkey) -- [AppImageKit](https://github.com/AppImage/AppImageKit) diff --git a/README_ru.md b/README_ru.md deleted file mode 100644 index b8828ee..0000000 --- a/README_ru.md +++ /dev/null @@ -1,124 +0,0 @@ -# NekoRay / NekoBox для ПК - -Основанный на библиотеке Qt кросс-платформенный GUI менеджер для конфигурации прокси (на базе ядер: v2ray / sing-box) - -Поддерживает Windows / Linux из коробки. - -## Загрузить - -### GitHub Релизы (Портативный ZIP-архив) - -Портативный формат, без установщика. Перейдите в раздел Releases, чтобы загрузить готовые к использованию, предварительно скомпилированные двоичные пакеты. - -[![GitHub All Releases](https://img.shields.io/github/downloads/Matsuridayo/nekoray/total?label=downloads-total&logo=github&style=flat-square)](https://github.com/Matsuridayo/nekoray/releases) - -[Загрузить](https://github.com/Matsuridayo/nekoray/releases) - -[Инструкция по установке пакета, если вы не знаете, какой из них загрузить (на китайском)](https://github.com/MatsuriDayo/nekoray/wiki/Installation-package-description) - -### Пакеты - -#### AUR - -- [nekoray](https://aur.archlinux.org/packages/nekoray) -- [nekoray-git](https://aur.archlinux.org/packages/nekoray-git) [![AUR CI](https://github.com/MatsuriDayo/nekoray/actions/workflows/update-pkgbuild.yml/badge.svg)](https://github.com/MatsuriDayo/nekoray/actions/workflows/update-pkgbuild.yaml) - -#### archlinuxcn - -- [nekoray](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/nekoray) -- [nekoray-git](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/nekoray-git) - -#### Scoop Extras - -`scoop install nekoray` - -## Список изменений & Телеграм Канал - -https://t.me/Matsuridayo - -## Домашняя страница & Документация - -https://matsuridayo.github.io - -## Прокси - -- SOCKS (4/4a/5) -- HTTP(S) -- Shadowsocks -- VMess -- VLESS -- Trojan -- TUIC ( sing-box ) -- NaïveProxy ( Пользовательское ядро ) -- Hysteria ( Пользовательское ядро или sing-box ) -- Hysteria2 ( Пользовательское ядро или sing-box ) -- Пользовательские Исходящие Запросы -- Пользовательская Конфигурация -- Пользовательское ядро - -## Подписка - -- Raw: некоторые широкоиспользуемые форматы (например, Shadowsocks, Clash и v2rayN) - -## Параметры работы - -[Параметры работы](docs/RunFlags.md) - -## Запуск на Windows - -Если появляется ошибка об отсутствии DLL или приложение не запускается, загрузите и установите [Библиотеки среды выполнения Microsoft C++](https://aka.ms/vs/17/release/vc_redist.x64.exe) - -## Запуск на Linux - -[Гайд по запуску на Linux (на китайском)](docs/Run_Linux.md) - -## macOS - -Из-за отсутствия поддержки версия для macOS больше не доступна для загрузки. - -Вы также можете скачать неофициальные обновленные версии в репозитории ниже. [Неофициальные релизы](https://github.com/aaaamirabbas/nekoray-macos/releases) - -Вы все еще можете обратиться к руководству ниже, чтобы скомпилировать самостоятельно. -Пожалуйста, присмотритесь устаревшим релизам, чтобы узнать о распространенных проблемах. В случае обнаружения ошибок Pull Requests приветствуется для внесения исправлений. - -## Гайд по компиляции - -Обратите внимание на: [Техническую Документацию](https://github.com/MatsuriDayo/nekoray/tree/main/docs) - -## Пожертвование - -Если этот проект окажется для вас полезным, вы можете помочь нам и дальше разрабатывать его, сделав пожертвование. - -Пожертвования в размере до 50 долларов США можно сделать на странице "Пожертвовать сейчас".[Список поддержавщих](https://mtrdnt.pages.dev/donation_list). Если вы не были добавлены сюда, не стесняйтесь связаться с нами. - -USDT TRC20 - -`TRhnA7SXE5Sap5gSG3ijxRmdYFiD4KRhPs` - -XMR - -`49bwESYQjoRL3xmvTcjZKHEKaiGywjLYVQJMUv79bXonGiyDCs8AzE3KiGW2ytTybBCpWJUvov8SjZZEGg66a4e59GXa6k5` - -- Донат через [Google Play](https://play.google.com/store/apps/details?id=moe.nb4a), используя банковскую карту. -- -## Авторы - -Ядра: - -- [v2fly/v2ray-core](https://github.com/v2fly/v2ray-core) ( < 3.10 ) -- [MatsuriDayo/Matsuri](https://github.com/MatsuriDayo/Matsuri) ( < 3.10 ) -- [MatsuriDayo/v2ray-core](https://github.com/MatsuriDayo/v2ray-core) ( < 3.10 ) -- [XTLS/Xray-core](https://github.com/XTLS/Xray-core) ( >= 3.10 ) -- [MatsuriDayo/Xray-core](https://github.com/MatsuriDayo/Xray-core) ( >= 3.10 ) -- [SagerNet/sing-box](https://github.com/SagerNet/sing-box) -- [Matsuridayo/sing-box-extra](https://github.com/MatsuriDayo/sing-box-extra) - -Gui: - -- [Qv2ray](https://github.com/Qv2ray/Qv2ray) -- [Qt](https://www.qt.io/) -- [protobuf](https://github.com/protocolbuffers/protobuf) -- [yaml-cpp](https://github.com/jbeder/yaml-cpp) -- [zxing-cpp](https://github.com/nu-book/zxing-cpp) -- [QHotkey](https://github.com/Skycoder42/QHotkey) -- [AppImageKit](https://github.com/AppImage/AppImageKit) diff --git a/cmake/macos/macos.cmake b/cmake/macos/macos.cmake deleted file mode 100644 index e69de29..0000000 diff --git a/db/ConfigBuilder.cpp b/db/ConfigBuilder.cpp index 4760304..77c27c2 100644 --- a/db/ConfigBuilder.cpp +++ b/db/ConfigBuilder.cpp @@ -2,7 +2,6 @@ #include "db/Database.hpp" #include "fmt/includes.h" #include "fmt/Preset.hpp" -#include "main/QJS.hpp" #include #include @@ -76,19 +75,6 @@ namespace NekoGui { // apply custom config MergeJson(QString2QJsonObject(ent->bean->custom_config), result->coreConfig); - // hook.js - if (result->error.isEmpty() && !forTest) { - auto source = qjs::ReadHookJS(); - if (!source.isEmpty()) { - qjs::QJS js(source); - auto js_result = js.EvalFunction("hook.hook_core_config", QJsonObject2QString(result->coreConfig, true)); - auto js_result_json = QString2QJsonObject(js_result); - if (!js_result_json.isEmpty() && result->coreConfig != js_result_json) { - MW_show_log("hook.js modified your " + software_core_name + " json config."); - result->coreConfig = js_result_json; - } - } - } return result; } @@ -1106,16 +1092,6 @@ namespace NekoGui { .replace("%DNS_ADDRESS%", BOX_UNDERLYING_DNS) .replace("%FAKE_DNS_INBOUND%", dataStore->fake_dns ? "tun-in" : "empty") .replace("%PORT%", Int2String(dataStore->inbound_socks_port)); - // hook.js - auto source = qjs::ReadHookJS(); - if (!source.isEmpty()) { - qjs::QJS js(source); - auto js_result = js.EvalFunction("hook.hook_tun_config", config); - if (config != js_result) { - MW_show_log("hook.js modified your Tun config."); - config = js_result; - } - } // write config QFile file; file.setFileName(QFileInfo(configFn).fileName()); @@ -1137,16 +1113,6 @@ namespace NekoGui { .replace("$PROTECT_LISTEN_PATH", protectPath) .replace("$CONFIG_PATH", configPath) .replace("$TABLE_FWMARK", "514"); - // hook.js - auto source = qjs::ReadHookJS(); - if (!source.isEmpty()) { - qjs::QJS js(source); - auto js_result = js.EvalFunction("hook.hook_tun_script", script); - if (script != js_result) { - MW_show_log("hook.js modified your Tun script."); - script = js_result; - } - } // write script QFile file2; file2.setFileName(QFileInfo(scriptFn).fileName()); diff --git a/docs/Build_Core.md b/docs/Build_Core.md index 5cf1eed..5f1d02c 100644 --- a/docs/Build_Core.md +++ b/docs/Build_Core.md @@ -1,11 +1,10 @@ -## 构建 nekoray_core & nekobox_core +## 构建 nekobox_core ### 目录结构 ``` | nekoray | go/cmd/* - | Xray-core | sing-box-extra | sing-box | ...... diff --git a/docs/Build_Core_fa.md b/docs/Build_Core_fa.md deleted file mode 100644 index a5b1e33..0000000 --- a/docs/Build_Core_fa.md +++ /dev/null @@ -1,32 +0,0 @@ -## ساخت nekoray_core و nekobox_core - -### ساختار دایرکتوری - -``` - | nekoray - | go/cmd/* - | Xray-core - | sing-box-extra - | sing-box - | ...... -``` - -### ساخت معمولی - -1. `bash libs/get_source.sh `(دریافت خودکار ساختار دایرکتوری، خودکار checkout commit) -2. `GOOS=windows GOARCH=amd64 bash libs/build_go.sh` - -برای مشاهده GOOS و GOARCH های پشتیبانی شده به `libs/build_go.sh` مراجعه کنید. - -در ساخت غیررسمی، نیازی به کامپایل `updater` و `launcher` نیست. - -### تگ‌های sing-box - -برای مشاهده تگ‌های استفاده شده به `libs/build_go.sh` مراجعه کنید. - - - - - - - diff --git a/docs/Build_Linux.md b/docs/Build_Linux.md index 50a8828..ad97f91 100644 --- a/docs/Build_Linux.md +++ b/docs/Build_Linux.md @@ -38,15 +38,13 @@ ninja | NKR_NO_QHOTKEY | | 不包含 qhotkey | | NKR_NO_ZXING | | 不包含 zxing | | NKR_NO_GRPC | | 不包含 gRPC | -| NKR_NO_QUICKJS | | 不包含 quickjs | | NKR_PACKAGE | | 编译 package 版本 (aur) | -| NKR_PACKAGE_MACOS | | 编译 macos 版本 | | NKR_LIBS | ./libs/deps/built | 依赖搜索目录 | | NKR_DISABLE_LIBS | | 禁用 NKR_LIBS | 1. `NKR_LIBS` 的值会被追加到 `CMAKE_PREFIX_PATH` 2. `NKR_PACKAGE` 打开后,`NKR_LIBS` 的默认值为 `./libs/deps/package` ,具体依赖请看 `build_deps_all.sh` -3. `NKR_PACKAGE_MACOS` 或 `NKR_PACKAGE` 打开后,应用将使用 appdata 目录存放配置,自动更新等功能将被禁用。 +3. `NKR_PACKAGE` 打开后,应用将使用 appdata 目录存放配置,自动更新等功能将被禁用。 ### C++ 部分 diff --git a/docs/Build_Linux_fa.md b/docs/Build_Linux_fa.md deleted file mode 100644 index 26464f0..0000000 --- a/docs/Build_Linux_fa.md +++ /dev/null @@ -1,74 +0,0 @@ -کامپایل کردن nekoray در لینوکس -## کلون کردن کد با گیت -``` -git clone https://github.com/MatsuriDayo/nekoray.git --recursive -``` -## روش کامپایل ساده - -پیش‌نیازها: - -1. وابستگی‌های C++ به نام‌ها: `protobuf yaml-cpp zxing-cpp` باید با مدیریت بسته نصب شده باشند و با نسخه‌های مورد نیاز سازگار باشند. -2. باید `qtbase`، `qtsvg`، `qttools`، `qtx11extras` نصب شده باشد. -3. Qt با نسخه `5.12.x` یا `5.15.x` باید نصب شده باشد. -4. سیستم باید `x86-64-linux-gnu` باشد. -```shell -mkdir build -cd build -cmake -GNinja .. -ninja -``` -پس از کامپایل، فایل nekoray به دست می‌آید. - -فایل‌های فشرده را از Release استخراج کرده و nekoray را جایگزین کنید، سپس launcher را حذف کنید. - -## روش دیگر کامپایل (پیشرفته) - - -### پارامترهای CMake - -| پارامتر CMake | مقدار پیش‌فرض | توضیح | -|-------------------|-------------------|-----------------------| -| QT_VERSION_MAJOR | 5 | نسخه QT | -| NKR_NO_EXTERNAL | | شامل وابستگی‌های خارجی C/C++ (همه زیرمجموعه‌ها) نشود | -| NKR_NO_YAML | | شامل yaml-cpp نشود | -| NKR_NO_QHOTKEY | | شامل qhotkey نشود | -| NKR_NO_ZXING | | شامل zxing نشود | -| NKR_NO_GRPC | | شامل gRPC نشود | -| NKR_NO_QUICKJS | | شامل quickjs نشود | -| NKR_PACKAGE | | نسخه‌ی بسته را کامپایل کنید (aur) | -| NKR_PACKAGE_MACOS | | نسخه‌ی macOS را کامپایل کنید | -| NKR_LIBS | ./libs/deps/built | مسیر جستجوی وابستگی‌ها | -| NKR_DISABLE_LIBS | | وابستگی‌های NKR_LIBS غیرفعال شود | - -1. مقدار `NKR_LIBS‍‍‍‍‍` به `CMAKE_PREFIX_PATH` اضافه می‌شود. - -2. در صورت فعال بودن `NKR_PACKAGE`، مقدار پیش‌فرض `NKR_LIBS` برابر با `./libs/deps/package` است، جزئیات وابستگی‌ها در `build_deps_all.sh` قابل مشاهده است. -3. در صورت فعال بودن `NKR_PACKAGE_MACOS` یا `NKR_PACKAGE`، برنامه از دایرکتوری appdata برای ذخیره تنظیمات و سایر عملیات استفاده می‌کند و قابلیت به‌روزرسانی خودکار غیرفعال خواهد شد. - -### C++ - -اگر توزیع شما وابستگی‌های C++ مورد نظر یا نسخه مورد نظر را نداشته باشد، می‌توانید به اسکریپت کامپایل `build_deps_all.sh` مراجعه کرده و خودتان کامپایل کنید. - -پیش‌نیازها: Qt با نسخه `5.12.x` یا `5.15.x` باید نصب شده باشد. - -#### کامپایل و نصب وابستگی‌های C/C++ - -(ممکن است به اتصال VPN نیاز داشته باشد) - -```shell -./libs/build_deps_all.sh -``` - -#### کامپایل برنامه اصلی - -```shell -mkdir build -cd build -cmake -GNinja .. -ninja -``` - -پس از کامپایل، فایل `nekoray` به دست می‌آید. - -### کامپایل بخش Go -لطفاً به [Build_Core_fa.md](./Build_Core_fa.md) مراجعه کنید. diff --git a/docs/Build_MacOS.md b/docs/Build_MacOS.md deleted file mode 100644 index 9ac7c86..0000000 --- a/docs/Build_MacOS.md +++ /dev/null @@ -1,67 +0,0 @@ -提示:编译通过不代表所有功能可用,Tun 系统代理 这种功能大概率是不可用的。如果您懂得修复,我们欢迎您的 Pull Request。 - -Tip: Passing the compilation does not mean that all functions are available, and the function of Tun system proxy is probably not available. If you know how to fix it, we welcome your Pull Request. - -## git clone 源码 - -``` -git clone https://github.com/MatsuriDayo/nekoray.git --recursive -``` - -## 先决条件 - -1. 安装 `CMake` `Ninja` `npm` -2. 安装 Qt `5.15.x` 编译环境,并设置好有关环境变量,以免 CMake 找不到 Qt。 (`qtbase` `qtsvg` `qttools`) -3. 安装 `appdmg` (`sudo npm install -g appdmg`) - -## CMake 参数 - -同 Build_Linux - -## C++ 部分 - -### 编译安装 C/C++ 依赖 - -(这一步可能要挂梯) - -```shell -./libs/build_deps_all.sh -``` - -### 编译本体 - -```shell -mkdir build -cd build -cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DNKR_PACKAGE_MACOS=1 .. -ninja -``` - -### Go 部分编译 - -请看 [Build_Core.md](./Build_Core.md) - -## 打包 - -如有疑问,请参考[这个脚本](https://github.com/MatsuriDayo/nekoray/blob/main/libs/deploy_macos.sh) - -### 准备core - -将 编译得到的 `nekoray_core` `nekobox_core` 放入 `build/nekoray.app/Contents/MacOS` - -### 准备geo文件(可选) - -```shell -curl -Lso build/nekoray.app/Contents/MacOS/geoip.dat "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat" -curl -Lso build/nekoray.app/Contents/MacOS/geosite.dat "https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat" -curl -Lso build/nekoray.app/Contents/MacOS/geoip.db "https://github.com/SagerNet/sing-geoip/releases/latest/download/geoip.db" -curl -Lso build/nekoray.app/Contents/MacOS/geosite.db "https://github.com/SagerNet/sing-geosite/releases/latest/download/geosite.db" -``` - -如果打包时没有包含geo文件,可在应用内设置 `v2ray资源路径` 代替。 - -### 在nekoray目录下打包 - -```shell -appdmg appdmg.json /path/to/nekoray.dmg -``` diff --git a/docs/Build_MacOS_fa.md b/docs/Build_MacOS_fa.md deleted file mode 100644 index df50cde..0000000 --- a/docs/Build_MacOS_fa.md +++ /dev/null @@ -1,163 +0,0 @@ -Tip: Passing the compilation does not mean that all functions are available, and the function of Tun system proxy is probably not available. If you know how to fix it, we welcome your Pull Request. - -## پروژه Nekoray را از منبع آن دریافت کنید -در `Terminal` در مسیر دلخواه خود، دستور زیر را وارد کنید و دکمه `return` را بفشارید. -```shell -git clone https://github.com/MatsuriDayo/nekoray.git --recursive -``` -اگر `git` روی دستگاه از پیش نصب نباشد، دستگاه، خودکار نصب آن را پیشنهاد می‌کند. مرحله‌های نصب را به انجام برسانید و سپس دوباره دستور پیش گفته را در `Terminal` اجرا کنید. - -سپس وارد پوشه `nekoray` شوید. -برای کامپایل کردن پروژه، پیش‌نیازهای زیر را نصب کنید. برای این، دستور زیر را در `Terminal` وارد کنید و دکمه `Return` را بفشارید. - - -```shell -cd nekoray -``` -
- -## پیش‌نیازها - -###۱. `CMake` - -برای نصب `CMake` دستور زیر را در `terminal` وارد کنید و دکمه `return` را بفشارید. -```shell -brew install cmake -``` -اگر با خطای `zsh: command not found: brew` روبه‌رو شدید به این معنی است که `homebrew` در دستگاه شما نصب نیست. برای نصب آن نخست باید `XCode's command line tools` را نصب کنید. اگر به این مشکل برخورده‌ اید، گام های `۱.۱`، `۱.۲` و `۱.۳` را دنبال کنید. - -
- -####۱.۱. نصب `XCode's command line tools` - -دستور زیر را در `terminal` وادر کنید و دکمه `return` را بفشارید. -```shell -xcode-select --install -``` - -
- -####۱.۲. نصب `homebrew` - -دستور زیر را در `terminal` وارد کنید و دکمه `return` را بفشارید. -```shell -curl -fsSL -o install.sh https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh -``` - -
- -####۱.۳. حال می‌توانید با دستوری که پیشتر گفتیم، `CMake` را نصب کنید. - -
- -###۲. `Ninja` - -برای نصب `Ninja` دستور زیر را در `terminal` وارد کنید و دکمه `return` را بفشارید. -```shell -sudo port install ninja -``` -اگر با خطای `sudo: port: command not found` روبه‌رو شدید، به این معنی است که `MacPorts` روی دستگاه شما نصب نیست. نسخه `MacPorts` متناسب با نسخه `macOs` خود را بارگری و نصب کنید. سپس بار دیگر، دستور نصب `Ninja` را در `terminal` وارد کرده و دکمه `return` را بفشارید. - -
- -###۳. `npm` - -برای نصب `npm` دستور زیر را در `terminal` وارد کنید و دکمه `return` را بفشارید. -```shell -brew install npm -``` - -
- -###۴. `qtbase` - -برای نصب `qtbase` دستور زیر را در `terminal` وارد کنید و دکمه `return` را بفشارید. -```shell -sudo port install qt5-qtbase -``` - -
- -###۵. `qtsvg` - -برای نصب `qtsvg` دستور زیر را در `terminal` وارد کنید و دکمه `return` را بفشارید. -```shell -sudo port install qt5-qtsvg -``` - -
- -###۶. `qttools` - -برای نصب `qttools` دستور زیر را در `terminal` وارد کنید و دکمه `return` را بفشارید. -```shell -sudo port install qt5-qttools -``` - -
- -###۷. `appdmg` - -برای نصب `appdmg` دستور زیر را در `terminal` وارد کنید و دکمه `return` را بفشارید. -```shell -sudo npm install -g appdmg -``` - -
- -## C++ - -### وابستگی‌های C و ++C را کامپایل و نصب کنید. - -دستور زیر را در `terminal` وارد کرده و دکمه `return` را بفشارید. - -```shell -./libs/build_deps_all.sh -``` - -
- -### آنتولوژی را کامپایل کنید. - -دستور زیر را در `terminal` وارد کرده و دکمه `return` را بفشارید. -```shell -mkdir build -cd build -cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DNKR_PACKAGE_MACOS=1 .. -ninja -``` - -
- -## هسته نرم افزار - -### هسته نرم افزار را کامپایل کنید. - -چگونگی کامپایل کردن هسته نرم افزار را [اینجا ](./Build_Core_fa.md)بخوانید. - -
- -### جایگذاری هسته - -فایل کامپایل شده `nekoray_core` و `nekobox_core` را در مسیر زیر کپی کنید. -`build/nekoray.app/Contents/MacOS` - -
- -## فایل‌های جغرافی را تهیه کنید. (اختیاری) - -اگر مایلید، با اجرای دستورهای زیر در `Terminal` فایل های جغرافی را تهیه کنید. - -```shell -curl -Lso build/nekoray.app/Contents/MacOS/geoip.dat "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat" -curl -Lso build/nekoray.app/Contents/MacOS/geosite.dat "https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat" -curl -Lso build/nekoray.app/Contents/MacOS/geoip.db "https://github.com/SagerNet/sing-geoip/releases/latest/download/geoip.db" -curl -Lso build/nekoray.app/Contents/MacOS/geosite.db "https://github.com/SagerNet/sing-geosite/releases/latest/download/geosite.db" -``` -
- -## پایان کار - -فایل اجرایی `Nekoray` در مسیر زیر قرار دارد. می‌توانید آن را در مسیر دلخواه کپی کنید. - -`مسیر پروژه Nekoray/build` \ No newline at end of file diff --git a/docs/Build_Windows_fa.md b/docs/Build_Windows_fa.md deleted file mode 100644 index a315b30..0000000 --- a/docs/Build_Windows_fa.md +++ /dev/null @@ -1,65 +0,0 @@ -کامپایل Nekoray در ویندوز - -### git clone - -``` -git clone https://github.com/MatsuriDayo/nekoray.git --recursive -``` - -### نصب Visual Studio - -با نصب از وب سایت رسمی مایکروسافت، می توانید از نسخه های 2019 و 2022 استفاده کنید و محیط توسعه ++Win32 C را نصب کنید. - -پس از نصب، می‌توانید `x64 Native Tools Command Prompt` را در منوی «شروع» پیدا کنید. - -دستورات زیر این مقاله همه در این cmd اجرا می شوند. `cmake‍‍‍` `ninja` و ابزارهای دیگر را می توان با VS استفاده کرد. - -### دانلود Qt SDK - -نسخه ای که در حال حاضر توسط Windows Release استفاده می شود Qt 6.5.x است. - -پس از دانلود و خارج کردن از حالت ظش، پوشه bin را به environment variable اضافه کنید. - -#### بسته Qt مورد استفاده برای کامپایل نسخه (MSVC2019 x86_64) را دانلود کنید - -https://github.com/MatsuriDayo/nekoray_qt_runtime/releases/download/20220503/Qt6.5.0-Windows-x86_64-VS2022-17.5.5-20230507.7z - -#### Official signed version of Qt 5.15.2 (optional, known memory leak bugs) - -پکیج های `qtbase` `qtsvg` `qttools` را از اینجا دانلود کنید و آن را در همان دایرکتوری استخراج کنید. - -https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt5_5152/qt.qt5.5152.win64_msvc2019_64/ - -### کامپایل جزئی ++c - -#### وابستگی های مورد نیاز ++C/C را کامپایل و نصب کنید - -(You may have to hang the ladder for this step) - -```shell -bash ./libs/build_deps_all.sh -``` - -در حال حاضر فقط اسکریپت های bash وجود دارد، بدون پردازش دسته ای یا پاورشل، اگر ویندوز همراه bash نیست، توصیه می شود خودتان آن را نصب کنید. - -جزئیاتی مانند پارامترهای CMake مشابه لینوکس است. اگر سوالی دارید، لطفاً به داکیومنت [Build_Linux_fa.md](./Build_Linux_fa.md) مراجعه کنید. - -#### کامپایل کد اصلی - -لطفاً دستورات را با موقعیت QT Sdk خود جایگزین کنید. - -```shell -mkdir build -cd build -cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=D:/path/to/qt/5.15.2/msvc2019_64 .. -ninja -``` - -بعد از اتمام کامپایل، فایل `nekoray.exe` را دریافت خواهید کرد. - -سپس با اجرای دستور `windeployqt nekoray.exe`، فایل‌های مورد نیاز مانند DLL به صورت خودکار در دایرکتوری فعلی کپی می‌شوند. - - -### بخش کامپایل Go - -لطفاً به [Build_Core_fa.md](./Build_Core_fa.md) مراجعه کنید. diff --git a/docs/HookJS.md b/docs/HookJS.md deleted file mode 100644 index 9050e42..0000000 --- a/docs/HookJS.md +++ /dev/null @@ -1,106 +0,0 @@ -# hook.js 使用 -## 如何启用 - -1. 打开 `基本设置 - 安全 - 启用 hook.js 功能` -2. js 代码请放置于 `config/hook.nekoray.js` 或 `config/hook.nekobox.js` - -## 技术信息 - -* JS Engine: QuickJS ES2020 -* 提供的接口:如下面代码所示 - -## 示例代码 (typescript) - -```ts -const globalAny: any = globalThis - -// 目前提供的方法 -interface nekoray_in { - log(...a: any): void -} - -// 目前提供的 hook 点 -interface nekoray_hook { - hook_core_config(config: string): string - hook_tun_config(config: string): string - hook_tun_script(script: string): string - hook_import(content: string): string -} - -class my_hook implements nekoray_hook { - private nekoray = globalAny.nekoray as nekoray_in - - hook_core_config(config: string): string { - var json = JSON.parse(config) - var my_rule = { - "geosite": "cn", - "server": "dns-direct", - "disable_cache": true - } - json["dns"]["rules"].push(my_rule) - return JSON.stringify(json) - } - - hook_tun_config(config: string): string { - return config // 返回输入,表示不修改 - } - - hook_tun_script(script: string): string { - console.log("Script") // 输出到 stdout - this.nekoray.log("Script:", script) // 输出到日志 - return script - } - - hook_import(content: string): string { - var newContent: Array = [] - content.split("\n").forEach((line: any) => { - if (line.startsWith("vmess://")) { - newContent.push(line) - } - }) - return newContent.join("\n") - } -} - -globalAny.hook = new my_hook -``` - -## 示例代码 (javascript) - -```js -var globalAny = globalThis; -var my_hook = /** @class */ (function () { - function my_hook() { - this.nekoray = globalAny.nekoray; - } - my_hook.prototype.hook_core_config = function (config) { - var json = JSON.parse(config); - var my_rule = { - "geosite": "cn", - "server": "dns-direct", - "disable_cache": true - }; - json["dns"]["rules"].push(my_rule); - return JSON.stringify(json); - }; - my_hook.prototype.hook_tun_config = function (config) { - return config; // 返回输入,表示不修改 - }; - my_hook.prototype.hook_tun_script = function (script) { - console.log("Script"); // 输出到 stdout - this.nekoray.log("Script:", script); // 输出到日志 - return script; - }; - my_hook.prototype.hook_import = function (content) { - var newContent = []; - content.split("\n").forEach(function (line) { - if (line.startsWith("vmess://")) { - newContent.push(line); - } - }); - return newContent.join("\n"); - }; - return my_hook; -}()); -globalAny.hook = new my_hook; -``` \ No newline at end of file diff --git a/docs/HookJS_fa.md b/docs/HookJS_fa.md deleted file mode 100644 index ed82c9f..0000000 --- a/docs/HookJS_fa.md +++ /dev/null @@ -1,106 +0,0 @@ -# استفاده از فایل hook.js -## فعالسازی - -1. `Basic Settings - Security - Enable hook.js function` را روشن کنید -2. کد JS را در `config/hook.nekoray.js` یا `config/hook.nekobox.js` قرار دهید. - -## Technical Information - -* JS engine: QuickJS ES2020. -* Provided interfaces: as shown in the following code - -## کد نمونه (typescript) - -```ts -const globalAny: any = globalThis - -// روش‌های ارائه‌شده در حال حاضر -interface nekoray_in { - log(...a: any): void -} - -// نقاط hook ارائه‌شده در حال حاضر -interface nekoray_hook { - hook_core_config(config: string): string - hook_tun_config(config: string): string - hook_tun_script(script: string): string - hook_import(content: string): string -} - -class my_hook implements nekoray_hook { - private nekoray = globalAny.nekoray as nekoray_in - - hook_core_config(config: string): string { - var json = JSON.parse(config) - var my_rule = { - "geosite": "cn", - "server": "dns-direct", - "disable_cache": true - } - json["dns"]["rules"].push(my_rule) - return JSON.stringify(json) - } - - hook_tun_config(config: string): string { - return config // بازگشت ورودی، نشان دهنده عدم تغییر - } - - hook_tun_script(script: string): string { - console.log("Script") // خروجی به stdout - this.nekoray.log("Script:", script) // خروجی به لاگ - return script - } - - hook_import(content: string): string { - var newContent: Array = [] - content.split("\n").forEach((line: any) => { - if (line.startsWith("vmess://")) { - newContent.push(line) - } - }) - return newContent.join("\n") - } -} - -globalAny.hook = new my_hook -``` - -## کد نمونه (javascript) - -```js -var globalAny = globalThis; -var my_hook = /** @class */ (function () { - function my_hook() { - this.nekoray = globalAny.nekoray; - } - my_hook.prototype.hook_core_config = function (config) { - var json = JSON.parse(config); - var my_rule = { - "geosite": "cn", - "server": "dns-direct", - "disable_cache": true - }; - json["dns"]["rules"].push(my_rule); - return JSON.stringify(json); - }; - my_hook.prototype.hook_tun_config = function (config) { - return config; // بازگشت ورودی، نشان دهنده عدم تغییر - }; - my_hook.prototype.hook_tun_script = function (script) { - console.log("Script"); // خروجی به stdout - this.nekoray.log("Script:", script); // خروجی به لاگ - return script; - }; - my_hook.prototype.hook_import = function (content) { - var newContent = []; - content.split("\n").forEach(function (line) { - if (line.startsWith("vmess://")) { - newContent.push(line); - } - }); - return newContent.join("\n"); - }; - return my_hook; -}()); -globalAny.hook = new my_hook; -``` diff --git a/docs/readme.md b/docs/readme.md index c84038f..c6c68fe 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -4,4 +4,3 @@ 1. Build GUI: `Build_*.md` 2. Build Core: `Build_Core.md` -3. Hook.js usage: `HookJS.md` diff --git a/go/cmd/nekoray_core/core_ray.go b/go/cmd/nekoray_core/core_ray.go deleted file mode 100644 index 7956ecb..0000000 --- a/go/cmd/nekoray_core/core_ray.go +++ /dev/null @@ -1,122 +0,0 @@ -package main - -import ( - "context" - "fmt" - "log" - "net" - "net/http" - "os" - "time" - - "github.com/matsuridayo/libneko/neko_common" - "github.com/matsuridayo/libneko/neko_log" - - appLog "github.com/xtls/xray-core/app/log" - commonLog "github.com/xtls/xray-core/common/log" - v2rayNet "github.com/xtls/xray-core/common/net" - core "github.com/xtls/xray-core/core" - "github.com/xtls/xray-core/features/dns" -) - -var instance *NekoV2RayInstance -var getNekorayTunIndex = func() int { return 0 } // Windows only -var underlyingNetDialer *net.Dialer - -type v2rayLogWriter struct { -} - -func (w *v2rayLogWriter) Write(s string) error { - log.Print(s) - return nil -} - -func (w *v2rayLogWriter) Close() error { - return nil -} - -func setupCore() { - // core setup - os.Setenv("v2ray.conf.geoloader", "memconservative") - neko_log.SetupLog(50*1024, "./neko.log") - _ = appLog.RegisterHandlerCreator(appLog.LogType_Console, func(lt appLog.LogType, options appLog.HandlerCreatorOptions) (commonLog.Handler, error) { - return commonLog.NewLogger(func() commonLog.Writer { - return &v2rayLogWriter{} - }), nil - }) - // localdns setup - resolver_def := &net.Resolver{PreferGo: false} - resolver_go := &net.Resolver{PreferGo: true} - if underlyingNetDialer != nil && os.Getenv("NKR_CORE_RAY_DIRECT_DNS") == "1" { - resolver_def.Dial = underlyingNetDialer.DialContext - resolver_go.Dial = underlyingNetDialer.DialContext - log.Println("using NKR_CORE_RAY_DIRECT_DNS") - } - v2rayNet.LookupIP = func(host string) (ips []net.IP, err error) { - // fix old sekai - defer func() { - if len(ips) == 0 { - log.Println("LookupIP error:", host, err) - err = dns.ErrEmptyResponse - } - }() - // Normal mode use system resolver (go bug) - if getNekorayTunIndex() == 0 { - return resolver_def.LookupIP(context.Background(), "ip", host) - } - // Windows Tun Mode use Go resolver - return resolver_go.LookupIP(context.Background(), "ip", host) - } - neko_common.GetCurrentInstance = func() interface{} { - return instance - } - neko_common.DialContext = func(ctx context.Context, specifiedInstance interface{}, network, addr string) (net.Conn, error) { - dest, err := v2rayNet.ParseDestination(fmt.Sprintf("%s:%s", network, addr)) - if err != nil { - return nil, err - } - if i, ok := specifiedInstance.(*NekoV2RayInstance); ok { - return core.Dial(ctx, i.Instance, dest) - } - if instance != nil { - return core.Dial(ctx, instance.Instance, dest) - } - return neko_common.DialContextSystem(ctx, network, addr) - } - neko_common.DialUDP = func(ctx context.Context, specifiedInstance interface{}) (net.PacketConn, error) { - if i, ok := specifiedInstance.(*NekoV2RayInstance); ok { - return core.DialUDP(ctx, i.Instance) - } - if instance != nil { - return core.DialUDP(ctx, instance.Instance) - } - return neko_common.DialUDPSystem(ctx) - } - neko_common.CreateProxyHttpClient = func(specifiedInstance interface{}) *http.Client { - if i, ok := specifiedInstance.(*NekoV2RayInstance); ok { - return createProxyHttpClient(i) - } - return createProxyHttpClient(instance) - } -} - -// PROXY - -func createProxyHttpClient(i *NekoV2RayInstance) *http.Client { - transport := &http.Transport{ - TLSHandshakeTimeout: time.Second * 3, - ResponseHeaderTimeout: time.Second * 3, - } - - if i != nil { - transport.DialContext = func(ctx context.Context, network, addr string) (net.Conn, error) { - return neko_common.DialContext(ctx, i, network, addr) - } - } - - client := &http.Client{ - Transport: transport, - } - - return client -} diff --git a/go/cmd/nekoray_core/go.mod b/go/cmd/nekoray_core/go.mod deleted file mode 100644 index 980651b..0000000 --- a/go/cmd/nekoray_core/go.mod +++ /dev/null @@ -1,74 +0,0 @@ -module nekoray_core - -go 1.21 - -toolchain go1.21.0 - -require ( - github.com/jsimonetti/rtnetlink v1.2.2 - github.com/matsuridayo/libneko v1.0.0 // replaced - github.com/xtls/xray-core v1.0.0 // replaced - grpc_server v1.0.0 - kernel.org/pub/linux/libs/security/libcap/cap v1.2.65 -) - -require ( - cloud.google.com/go/compute/metadata v0.2.3 // indirect - github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect - github.com/andybalholm/brotli v1.0.5 // indirect - github.com/dgryski/go-metro v0.0.0-20211217172704-adc40b04c140 // indirect - github.com/francoispqt/gojay v1.2.13 // indirect - github.com/gaukas/godicttls v0.0.4 // indirect - github.com/ghodss/yaml v1.0.1-0.20220118164431-d8423dcdf344 // indirect - github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect - github.com/golang/mock v1.6.0 // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/google/btree v1.1.2 // indirect - github.com/google/go-cmp v0.5.9 // indirect - github.com/google/pprof v0.0.0-20230821062121-407c9e7a662f // indirect - github.com/gorilla/websocket v1.5.0 // indirect - github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect - github.com/josharian/native v1.0.0 // indirect - github.com/klauspost/compress v1.16.7 // indirect - github.com/klauspost/cpuid/v2 v2.2.5 // indirect - github.com/mdlayher/netlink v1.6.0 // indirect - github.com/mdlayher/socket v0.1.1 // indirect - github.com/onsi/ginkgo/v2 v2.12.0 // indirect - github.com/pelletier/go-toml v1.9.5 // indirect - github.com/pires/go-proxyproto v0.7.0 // indirect - github.com/quic-go/qtls-go1-20 v0.3.3 // indirect - github.com/quic-go/quic-go v0.38.1 // indirect - github.com/refraction-networking/utls v1.4.3 // indirect - github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 // indirect - github.com/sagernet/sing v0.2.9 // indirect - github.com/sagernet/sing-shadowsocks v0.2.4 // indirect - github.com/sagernet/wireguard-go v0.0.0-20221116151939-c99467f53f2c // indirect - github.com/seiflotfy/cuckoofilter v0.0.0-20220411075957-e3b120b3f5fb // indirect - github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e // indirect - github.com/xtls/reality v0.0.0-20230828171259-e426190d57f6 // indirect - go.uber.org/atomic v1.11.0 // indirect - go4.org/netipx v0.0.0-20230824141953-6213f710f925 // indirect - golang.org/x/crypto v0.12.0 // indirect - golang.org/x/exp v0.0.0-20230725093048-515e97ebf090 // indirect - golang.org/x/mod v0.12.0 // indirect - golang.org/x/net v0.14.0 // indirect - golang.org/x/sync v0.3.0 // indirect - golang.org/x/sys v0.11.0 // indirect - golang.org/x/text v0.12.0 // indirect - golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.12.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect - google.golang.org/grpc v1.57.0 // indirect - google.golang.org/protobuf v1.31.0 // indirect - gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect - gvisor.dev/gvisor v0.0.0-20230822212503-5bf4e5f98744 // indirect - kernel.org/pub/linux/libs/security/libcap/psx v1.2.65 // indirect - lukechampine.com/blake3 v1.2.1 // indirect -) - -replace github.com/matsuridayo/libneko v1.0.0 => ../../../../libneko - -replace grpc_server v1.0.0 => ../../grpc_server - -replace github.com/xtls/xray-core => ../../../../Xray-core diff --git a/go/cmd/nekoray_core/go.sum b/go/cmd/nekoray_core/go.sum deleted file mode 100644 index 6476c65..0000000 --- a/go/cmd/nekoray_core/go.sum +++ /dev/null @@ -1,394 +0,0 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.37.0 h1:69FNAINiZfsEuwH3fKq8QrAAnHz+2m4XL4kVYi5BX0Q= -cloud.google.com/go v0.37.0/go.mod h1:TS1dMSSfndXH133OKGwekG838Om/cQT0BUHV3HcBgoo= -cloud.google.com/go/compute v1.19.1 h1:am86mquDUgjGNWxiGn+5PGLbmgiWXlE/yNWpIpNvuXY= -cloud.google.com/go/compute v1.19.1/go.mod h1:6ylj3a05WF8leseCdIf77NK0g1ey+nj5IKd5/kvShxE= -cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= -cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= -dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl+fi1br7+Rr3LqpNJf1/uxUdtRUV+Tnj0o93V2B9MU= -dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBrvjyP0v+ecvNYvCpyZgu5/xkfAUhi6wJj28eUfSU= -dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4= -dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU= -git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da h1:KjTM2ks9d14ZYCvmHS9iAKVt9AyzRSqNU1qabPih5BY= -github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da/go.mod h1:eHEWzANqSiWQsof+nXEI9bUVUyV6F53Fp89EuCh2EAA= -github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= -github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= -github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cilium/ebpf v0.9.1/go.mod h1:+OhNOIXx/Fnu1IE8bJz2dzOA+VSfyTfdNUVdlQnxUFY= -github.com/cilium/ebpf v0.9.3 h1:5KtxXZU+scyERvkJMEm16TbScVvuuMrlhPly78ZMbSc= -github.com/cilium/ebpf v0.9.3/go.mod h1:w27N4UjpaQ9X/DGrSugxUG+H+NhgntDuPb5lCzxCn8A= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgryski/go-metro v0.0.0-20200812162917-85c65e2d0165/go.mod h1:c9O8+fpSOX1DM8cPNSkX/qsBWdkD4yd2dpciOWQjpBw= -github.com/dgryski/go-metro v0.0.0-20211217172704-adc40b04c140 h1:y7y0Oa6UawqTFPCDw9JG6pdKt4F9pAhHv0B7FMGaGD0= -github.com/dgryski/go-metro v0.0.0-20211217172704-adc40b04c140/go.mod h1:c9O8+fpSOX1DM8cPNSkX/qsBWdkD4yd2dpciOWQjpBw= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= -github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= -github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/gaukas/godicttls v0.0.4 h1:NlRaXb3J6hAnTmWdsEKb9bcSBD6BvcIjdGdeb0zfXbk= -github.com/gaukas/godicttls v0.0.4/go.mod h1:l6EenT4TLWgTdwslVb4sEMOCf7Bv0JAK67deKr9/NCI= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/ghodss/yaml v1.0.1-0.20220118164431-d8423dcdf344 h1:Arcl6UOIS/kgO2nW3A65HN+7CMjSDP/gofXL4CZt1V4= -github.com/ghodss/yaml v1.0.1-0.20220118164431-d8423dcdf344/go.mod h1:GIjDIg/heH5DOkXY3YJ/wNhfHsQHoXGjl8G8amsYQ1I= -github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= -github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= -github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20230821062121-407c9e7a662f h1:pDhu5sgp8yJlEF/g6osliIIpF9K4F5jvkULXa4daRDQ= -github.com/google/pprof v0.0.0-20230821062121-407c9e7a662f/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= -github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= -github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= -github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= -github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= -github.com/josharian/native v1.0.0 h1:Ts/E8zCSEsG17dUqv7joXJFybuMLjQfWE04tsBODTxk= -github.com/josharian/native v1.0.0/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w= -github.com/jsimonetti/rtnetlink v1.2.2 h1:Ok9vYMcpxfHyF/iRqNTYJPDLxVaVItvPamAhtzttDBY= -github.com/jsimonetti/rtnetlink v1.2.2/go.mod h1:T3BJ2qI9ZJFkUYWLrzECdcXhCvaGRfnMFmoYF0X8w2A= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= -github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= -github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= -github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mdlayher/netlink v1.6.0 h1:rOHX5yl7qnlpiVkFWoqccueppMtXzeziFjWAjLg6sz0= -github.com/mdlayher/netlink v1.6.0/go.mod h1:0o3PlBmGst1xve7wQ7j/hwpNaFaH4qCRyWCdcZk8/vA= -github.com/mdlayher/socket v0.1.1 h1:q3uOGirUPfAV2MUoaC7BavjQ154J7+JOkTWyiV+intI= -github.com/mdlayher/socket v0.1.1/go.mod h1:mYV5YIZAfHh4dzDVzI8x8tWLWCliuX8Mon5Awbj+qDs= -github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= -github.com/miekg/dns v1.1.55 h1:GoQ4hpsj0nFLYe+bWiCToyrBEJXkQfOOIvFGFy0lEgo= -github.com/miekg/dns v1.1.55/go.mod h1:uInx36IzPl7FYnDcMeVWxj9byh7DutNykX4G9Sj60FY= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= -github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= -github.com/onsi/ginkgo/v2 v2.12.0 h1:UIVDowFPwpg6yMUpPjGkYvf06K3RAiJXUhCxEwQVHRI= -github.com/onsi/ginkgo/v2 v2.12.0/go.mod h1:ZNEzXISYlqpb8S36iN71ifqLi3vVD1rVJGvWRCJOUpQ= -github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= -github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= -github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= -github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pires/go-proxyproto v0.7.0 h1:IukmRewDQFWC7kfnb66CSomk2q/seBuilHBYFwyq0Hs= -github.com/pires/go-proxyproto v0.7.0/go.mod h1:Vz/1JPY/OACxWGQNIRY2BeyDmpoaWmEP40O9LbuiFR4= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/quic-go/qtls-go1-20 v0.3.3 h1:17/glZSLI9P9fDAeyCHBFSWSqJcwx1byhLwP5eUIDCM= -github.com/quic-go/qtls-go1-20 v0.3.3/go.mod h1:X9Nh97ZL80Z+bX/gUXMbipO6OxdiDi58b/fMC9mAL+k= -github.com/quic-go/quic-go v0.38.1 h1:M36YWA5dEhEeT+slOu/SwMEucbYd0YFidxG3KlGPZaE= -github.com/quic-go/quic-go v0.38.1/go.mod h1:ijnZM7JsFIkp4cRyjxJNIzdSfCLmUMg9wdyhGmg+SN4= -github.com/refraction-networking/utls v1.4.3 h1:BdWS3BSzCwWCFfMIXP3mjLAyQkdmog7diaD/OqFbAzM= -github.com/refraction-networking/utls v1.4.3/go.mod h1:4u9V/awOSBrRw6+federGmVJQfPtemEqLBXkML1b0bo= -github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 h1:f/FNXud6gA3MNr8meMVVGxhp+QBTqY91tM8HjEuMjGg= -github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3/go.mod h1:HgjTstvQsPGkxUsCd2KWxErBblirPizecHcpD3ffK+s= -github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/sagernet/sing v0.2.9 h1:3wsTz+JG5Wzy65eZnh6AuCrD2QqcRF6Iq6f7ttmJsAo= -github.com/sagernet/sing v0.2.9/go.mod h1:Ta8nHnDLAwqySzKhGoKk4ZIB+vJ3GTKj7UPrWYvM+4w= -github.com/sagernet/sing-shadowsocks v0.2.4 h1:s/CqXlvFAZhlIoHWUwPw5CoNnQ9Ibki9pckjuugtVfY= -github.com/sagernet/sing-shadowsocks v0.2.4/go.mod h1:80fNKP0wnqlu85GZXV1H1vDPC/2t+dQbFggOw4XuFUM= -github.com/sagernet/wireguard-go v0.0.0-20221116151939-c99467f53f2c h1:vK2wyt9aWYHHvNLWniwijBu/n4pySypiKRhN32u/JGo= -github.com/sagernet/wireguard-go v0.0.0-20221116151939-c99467f53f2c/go.mod h1:euOmN6O5kk9dQmgSS8Df4psAl3TCjxOz0NW60EWkSaI= -github.com/seiflotfy/cuckoofilter v0.0.0-20220411075957-e3b120b3f5fb h1:XfLJSPIOUX+osiMraVgIrMR27uMXnRJWGm1+GL8/63U= -github.com/seiflotfy/cuckoofilter v0.0.0-20220411075957-e3b120b3f5fb/go.mod h1:bR6DqgcAl1zTcOX8/pE2Qkj9XO00eCNqmKb7lXP8EAg= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY= -github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48/go.mod h1:5u70Mqkb5O5cxEA8nxTsgrgLehJeAw6Oc4Ab1c/P1HM= -github.com/shurcooL/github_flavored_markdown v0.0.0-20181002035957-2122de532470/go.mod h1:2dOwnU2uBioM+SGy2aZoq1f/Sd1l9OkAeAUvjSyvgU0= -github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= -github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= -github.com/shurcooL/gofontwoff v0.0.0-20180329035133-29b52fc0a18d/go.mod h1:05UtEgK5zq39gLST6uB0cf3NEHjETfB4Fgr3Gx5R9Vw= -github.com/shurcooL/gopherjslib v0.0.0-20160914041154-feb6d3990c2c/go.mod h1:8d3azKNyqcHP1GaQE/c6dDgjkgSx2BZ4IoEi4F1reUI= -github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b/go.mod h1:ZpfEhSmds4ytuByIcDnOLkTHGUI6KNqRNPDLHDk+mUU= -github.com/shurcooL/highlight_go v0.0.0-20181028180052-98c3abbbae20/go.mod h1:UDKB5a1T23gOMUJrI+uSuH0VRDStOiUVSjBTRDVBVag= -github.com/shurcooL/home v0.0.0-20181020052607-80b7ffcb30f9/go.mod h1:+rgNQw2P9ARFAs37qieuu7ohDNQ3gds9msbT2yn85sg= -github.com/shurcooL/htmlg v0.0.0-20170918183704-d01228ac9e50/go.mod h1:zPn1wHpTIePGnXSHpsVPWEktKXHr6+SS6x/IKRb7cpw= -github.com/shurcooL/httperror v0.0.0-20170206035902-86b7830d14cc/go.mod h1:aYMfkZ6DWSJPJ6c4Wwz3QtW22G7mf/PEgaB9k/ik5+Y= -github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= -github.com/shurcooL/httpgzip v0.0.0-20180522190206-b1c53ac65af9/go.mod h1:919LwcH0M7/W4fcZ0/jy0qGght1GIhqyS/EgWGH2j5Q= -github.com/shurcooL/issues v0.0.0-20181008053335-6292fdc1e191/go.mod h1:e2qWDig5bLteJ4fwvDAc2NHzqFEthkqn7aOZAOpj+PQ= -github.com/shurcooL/issuesapp v0.0.0-20180602232740-048589ce2241/go.mod h1:NPpHK2TI7iSaM0buivtFUc9offApnI0Alt/K8hcHy0I= -github.com/shurcooL/notifications v0.0.0-20181007000457-627ab5aea122/go.mod h1:b5uSkrEVM1jQUspwbixRBhaIjIzL2xazXp6kntxYle0= -github.com/shurcooL/octicon v0.0.0-20181028054416-fa4f57f9efb2/go.mod h1:eWdoE5JD4R5UVWDucdOPg1g2fqQRq78IQa9zlOV1vpQ= -github.com/shurcooL/reactions v0.0.0-20181006231557-f2e0b4ca5b82/go.mod h1:TCR1lToEk4d2s07G3XGfz2QrgHXg4RJBvjrOozvoWfk= -github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYEDaXHZDBsXlPCDqdhQuJkuw4NOtaxYe3xii4= -github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= -github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= -github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e h1:5QefA066A1tF8gHIiADmOVOV5LS43gt3ONnlEl3xkwI= -github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e/go.mod h1:5t19P9LBIrNamL6AcMQOncg/r10y3Pc01AbHeMhwlpU= -github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= -github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM= -github.com/xtls/reality v0.0.0-20230828171259-e426190d57f6 h1:T+YCYGfFdzyaKTDCdZn/hEiKvsw6yUfd+e4hze0rCUw= -github.com/xtls/reality v0.0.0-20230828171259-e426190d57f6/go.mod h1:rkuAY1S9F8eI8gDiPDYvACE8e2uwkyg8qoOTuwWov7Y= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= -go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= -go4.org/netipx v0.0.0-20230824141953-6213f710f925 h1:eeQDDVKFkx0g4Hyy8pHgmZaK0EqB4SD6rvKbUdN3ziQ= -go4.org/netipx v0.0.0-20230824141953-6213f710f925/go.mod h1:PLyyIXexvUFg3Owu6p/WfdlivPbZJsZdgWZlrGope/Y= -golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw= -golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= -golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20230725093048-515e97ebf090 h1:Di6/M8l0O2lCLc6VVRWhgCiApHV8MnQurBnFSHsQtNY= -golang.org/x/exp v0.0.0-20230725093048-515e97ebf090/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= -golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= -golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= -golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= -golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190316082340-a2f829d7f35f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220408201424-a24fb2fb8a0f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss= -golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg= -google.golang.org/genproto v0.0.0-20190306203927-b5d61aea6440/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= -google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= -google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw= -google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= -gvisor.dev/gvisor v0.0.0-20230822212503-5bf4e5f98744 h1:tE44CyJgxEGzoPtHs9GI7ddKdgEGCREQBP54AmaVM+I= -gvisor.dev/gvisor v0.0.0-20230822212503-5bf4e5f98744/go.mod h1:lYEMhXbxgudVhALYsMQrBaUAjM3NMinh8mKL1CJv7rc= -honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -kernel.org/pub/linux/libs/security/libcap/cap v1.2.65 h1:gIDtZoGnKeoIZ7XaKRmljMib4JV/TsjUhSzAeShNl6U= -kernel.org/pub/linux/libs/security/libcap/cap v1.2.65/go.mod h1:Fp9fDSuNh1vVDA7sozXklfQ+LxXMpB5/H4hDR8eu+0s= -kernel.org/pub/linux/libs/security/libcap/psx v1.2.65 h1:v2G3aCgEMr8qh4GpOGMukkv92EE7jtY+Uh9mB7cAACk= -kernel.org/pub/linux/libs/security/libcap/psx v1.2.65/go.mod h1:+l6Ee2F59XiJ2I6WR5ObpC1utCQJZ/VLsEbQCD8RG24= -lukechampine.com/blake3 v1.2.1 h1:YuqqRuaqsGV71BV/nm9xlI0MKUv4QC54jQnBChWbGnI= -lukechampine.com/blake3 v1.2.1/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= -sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= -sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= diff --git a/go/cmd/nekoray_core/grpc_ray.go b/go/cmd/nekoray_core/grpc_ray.go deleted file mode 100644 index d4fa7b9..0000000 --- a/go/cmd/nekoray_core/grpc_ray.go +++ /dev/null @@ -1,162 +0,0 @@ -package main - -import ( - "context" - "errors" - "fmt" - "grpc_server" - "grpc_server/gen" - "log" - - "github.com/matsuridayo/libneko/neko_common" - "github.com/matsuridayo/libneko/speedtest" - - "github.com/xtls/xray-core/nekoutils" -) - -type server struct { - grpc_server.BaseServer -} - -func (s *server) Start(ctx context.Context, in *gen.LoadConfigReq) (out *gen.ErrorResp, _ error) { - var err error - - defer func() { - out = &gen.ErrorResp{} - if err != nil { - out.Error = err.Error() - instance = nil - } - }() - - if neko_common.Debug { - log.Println("Start:", in.CoreConfig) - log.Println("EnableNekorayConnections:", in.EnableNekorayConnections) - } - - if instance != nil { - err = errors.New("instance already started") - return - } - - instance, err = NewNekoV2rayInstance(in.CoreConfig) - if err != nil { - return - } - - nekoutils.SetConnectionPoolV2RayEnabled(instance.CorePtr(), in.EnableNekorayConnections) - - err = instance.Start() - if err != nil { - return - } - - return -} - -func (s *server) Stop(ctx context.Context, in *gen.EmptyReq) (out *gen.ErrorResp, _ error) { - var err error - - defer func() { - out = &gen.ErrorResp{} - if err != nil { - out.Error = err.Error() - } - }() - - if instance == nil { - return - } - - err = instance.Close() - instance = nil - - return -} - -func (s *server) Test(ctx context.Context, in *gen.TestReq) (out *gen.TestResp, _ error) { - var err error - out = &gen.TestResp{Ms: 0} - - defer func() { - if err != nil { - out.Error = err.Error() - } - }() - - if neko_common.Debug { - log.Println("Test:", in) - } - - if in.Mode == gen.TestMode_UrlTest { - var i *NekoV2RayInstance - - if in.Config != nil { - // Test instance - i, err = NewNekoV2rayInstance(in.Config.CoreConfig) - if err != nil { - return - } - defer i.Close() - - err = i.Start() - if err != nil { - return - } - } else { - // Test running instance - i = instance - if i == nil { - return - } - } - - // Latency - var t int32 - t, err = speedtest.UrlTest(createProxyHttpClient(i), in.Url, in.Timeout) - out.Ms = t // sn: ms==0 是错误 - } else if in.Mode == gen.TestMode_TcpPing { - out.Ms, err = speedtest.TcpPing(in.Address, in.Timeout) - } else if in.Mode == gen.TestMode_FullTest { - if in.Config == nil { - return - } - // Test instance - i, err := NewNekoV2rayInstance(in.Config.CoreConfig) - if err != nil { - return - } - defer i.Close() - - err = i.Start() - if err != nil { - return - } - - return grpc_server.DoFullTest(ctx, in, i) - } - - return -} - -func (s *server) QueryStats(ctx context.Context, in *gen.QueryStatsReq) (out *gen.QueryStatsResp, _ error) { - out = &gen.QueryStatsResp{} - if instance != nil && instance.StatsManager != nil { - counter := instance.StatsManager.GetCounter(fmt.Sprintf("outbound>>>%s>>>traffic>>>%s", in.Tag, in.Direct)) - if counter != nil { - out.Traffic = counter.Set(0) - } - } - return -} - -func (s *server) ListConnections(ctx context.Context, in *gen.EmptyReq) (out *gen.ListConnectionsResp, _ error) { - // nekoray_connections_json - - out = &gen.ListConnectionsResp{} - if instance != nil { - out.NekorayConnectionsJson = nekoutils.ListConnections(instance.CorePtr()) - } - - return -} diff --git a/go/cmd/nekoray_core/import.go b/go/cmd/nekoray_core/import.go deleted file mode 100644 index c153190..0000000 --- a/go/cmd/nekoray_core/import.go +++ /dev/null @@ -1,86 +0,0 @@ -package main - -import ( - // The following are necessary as they register handlers in their init functions. - - // Mandatory features. Can't remove unless there are replacements. - _ "github.com/xtls/xray-core/app/dispatcher" - _ "github.com/xtls/xray-core/app/proxyman/inbound" - _ "github.com/xtls/xray-core/app/proxyman/outbound" - - // Default commander and all its services. This is an optional feature. - _ "github.com/xtls/xray-core/app/commander" - _ "github.com/xtls/xray-core/app/log/command" - _ "github.com/xtls/xray-core/app/proxyman/command" - _ "github.com/xtls/xray-core/app/stats/command" - - // Developer preview services - _ "github.com/xtls/xray-core/app/observatory/command" - - // Other optional features. - _ "github.com/xtls/xray-core/app/dns" - _ "github.com/xtls/xray-core/app/dns/fakedns" - _ "github.com/xtls/xray-core/app/log" - _ "github.com/xtls/xray-core/app/metrics" - _ "github.com/xtls/xray-core/app/policy" - _ "github.com/xtls/xray-core/app/reverse" - _ "github.com/xtls/xray-core/app/router" - _ "github.com/xtls/xray-core/app/stats" - - // Fix dependency cycle caused by core import in internet package - _ "github.com/xtls/xray-core/transport/internet/tagged/taggedimpl" - - // Developer preview features - _ "github.com/xtls/xray-core/app/observatory" - - // Inbound and outbound proxies. - _ "github.com/xtls/xray-core/proxy/blackhole" - _ "github.com/xtls/xray-core/proxy/dns" - _ "github.com/xtls/xray-core/proxy/dokodemo" - _ "github.com/xtls/xray-core/proxy/freedom" - _ "github.com/xtls/xray-core/proxy/http" - _ "github.com/xtls/xray-core/proxy/loopback" - _ "github.com/xtls/xray-core/proxy/shadowsocks" - _ "github.com/xtls/xray-core/proxy/socks" - _ "github.com/xtls/xray-core/proxy/trojan" - _ "github.com/xtls/xray-core/proxy/vless/inbound" - _ "github.com/xtls/xray-core/proxy/vless/outbound" - _ "github.com/xtls/xray-core/proxy/vmess/inbound" - _ "github.com/xtls/xray-core/proxy/vmess/outbound" - _ "github.com/xtls/xray-core/proxy/wireguard" - - // Transports - _ "github.com/xtls/xray-core/transport/internet/domainsocket" - _ "github.com/xtls/xray-core/transport/internet/grpc" - _ "github.com/xtls/xray-core/transport/internet/http" - _ "github.com/xtls/xray-core/transport/internet/kcp" - _ "github.com/xtls/xray-core/transport/internet/quic" - _ "github.com/xtls/xray-core/transport/internet/reality" - _ "github.com/xtls/xray-core/transport/internet/tcp" - _ "github.com/xtls/xray-core/transport/internet/tls" - _ "github.com/xtls/xray-core/transport/internet/udp" - _ "github.com/xtls/xray-core/transport/internet/websocket" - - // Transport headers - _ "github.com/xtls/xray-core/transport/internet/headers/http" - _ "github.com/xtls/xray-core/transport/internet/headers/noop" - _ "github.com/xtls/xray-core/transport/internet/headers/srtp" - _ "github.com/xtls/xray-core/transport/internet/headers/tls" - _ "github.com/xtls/xray-core/transport/internet/headers/utp" - _ "github.com/xtls/xray-core/transport/internet/headers/wechat" - _ "github.com/xtls/xray-core/transport/internet/headers/wireguard" - - // JSON & TOML & YAML - _ "github.com/xtls/xray-core/main/json" - // _ "github.com/xtls/xray-core/main/toml" - // _ "github.com/xtls/xray-core/main/yaml" - - // Load config from file or http(s) - // _ "github.com/xtls/xray-core/main/confloader/external" - - // Commands - // _ "github.com/xtls/xray-core/main/commands/all" - - // Custom - _ "github.com/xtls/xray-core/proxy/shadowsocks/plugin/v2ray_plugin" -) diff --git a/go/cmd/nekoray_core/instance.go b/go/cmd/nekoray_core/instance.go deleted file mode 100644 index 402b974..0000000 --- a/go/cmd/nekoray_core/instance.go +++ /dev/null @@ -1,50 +0,0 @@ -package main - -import ( - "log" - "strings" - - core "github.com/xtls/xray-core/core" - "github.com/xtls/xray-core/features/stats" - "github.com/xtls/xray-core/nekoutils" -) - -type NekoV2RayInstance struct { - *core.Instance - - StatsManager stats.Manager -} - -func NewNekoV2rayInstance(configStr string) (*NekoV2RayInstance, error) { - // load v4 or v5 config - var config *core.Config - var err error - - config, err = core.LoadConfig("json", strings.NewReader(configStr)) - if err != nil { - log.Println(configStr, err.Error()) - return nil, err - } - - c, err := core.New(config) - if err != nil { - return nil, err - } - - instance := &NekoV2RayInstance{ - Instance: c, - } - instance.StatsManager = c.GetFeature(stats.ManagerType()).(stats.Manager) - - return instance, nil -} - -func (i *NekoV2RayInstance) CorePtr() uintptr { - return 0 -} - -func (i *NekoV2RayInstance) Close() error { - nekoutils.ResetConnections(i.CorePtr()) - nekoutils.SetConnectionPoolV2RayEnabled(i.CorePtr(), false) - return i.Instance.Close() -} diff --git a/go/cmd/nekoray_core/main.go b/go/cmd/nekoray_core/main.go deleted file mode 100644 index 448c98a..0000000 --- a/go/cmd/nekoray_core/main.go +++ /dev/null @@ -1,32 +0,0 @@ -package main - -import ( - "fmt" - "grpc_server" - "os" - _ "unsafe" - - "github.com/matsuridayo/libneko/neko_common" -) - -//go:linkname build github.com/xtls/xray-core/core.build -var build string - -func main() { - build = "Matsuridayo/nekoray" - fmt.Println("Xray:", neko_common.Version_v2ray, "NekoRay:", neko_common.Version_neko) - fmt.Println() - - // nekoray_core - if len(os.Args) > 1 && os.Args[1] == "nekoray" { - neko_common.RunMode = neko_common.RunMode_NekoRay_Core - grpc_server.RunCore(setupCore, &server{}) - return - } - - // tool - if len(os.Args) > 1 && os.Args[1] == "tool" { - ToolBox() - return - } -} diff --git a/go/cmd/nekoray_core/protect_bindinterface_windows.go b/go/cmd/nekoray_core/protect_bindinterface_windows.go deleted file mode 100644 index 05a35ec..0000000 --- a/go/cmd/nekoray_core/protect_bindinterface_windows.go +++ /dev/null @@ -1,194 +0,0 @@ -package main - -import ( - "encoding/binary" - "log" - "net" - "os" - "strings" - "sync" - "syscall" - "unsafe" - - "github.com/matsuridayo/libneko/iphlpapi" - - "github.com/xtls/xray-core/transport/internet" -) - -// https://docs.microsoft.com/en-us/windows/win32/api/ipmib/ns-ipmib-mib_ipforwardrow -var routes []iphlpapi.RouteRow -var interfaces []net.Interface -var lock sync.Mutex - -func init() { - if os.Getenv("NKR_CORE_RAY_WINDOWS_DISABLE_AUTO_INTERFACE") == "1" { - log.Println("using NKR_CORE_RAY_WINDOWS_DISABLE_AUTO_INTERFACE") - } else { - initRoute() - } - // - getNekorayTunIndex = func() (index int) { - lock.Lock() - defer lock.Unlock() - for _, intf := range interfaces { - if intf.Name == "nekoray-tun" { - index = intf.Index - return - } - } - return - } -} - -func initRoute() { - internet.RegisterListenerController(func(network, address string, conn syscall.RawConn) error { - var err error - conn.Control(func(fd uintptr) { - bindInterfaceIndex := getBindInterfaceIndex(address) - if bindInterfaceIndex != 0 { - if err = bindInterface(fd, bindInterfaceIndex, true, true); err != nil { - log.Println("bind inbound interface", network, address, err) - } - } - }) - return err - }) - internet.RegisterDialerController(func(network, address string, conn syscall.RawConn) error { - var err error - conn.Control(func(fd uintptr) { - bindInterfaceIndex := getBindInterfaceIndex(address) - if bindInterfaceIndex != 0 { - var v4, v6 bool - if strings.HasSuffix(network, "6") { - v4 = false - v6 = true - } else { - v4 = true - v6 = false - } - if err = bindInterface(fd, bindInterfaceIndex, v4, v6); err != nil { - log.Println("bind outbound interface", network, address, err) - } - } - }) - return err - }) - underlyingNetDialer = &net.Dialer{ - Control: func(network, address string, c syscall.RawConn) error { - c.Control(func(fd uintptr) { - bindInterfaceIndex := getBindInterfaceIndex(address) - if bindInterfaceIndex != 0 { - var v4, v6 bool - if strings.HasSuffix(network, "6") { - v4 = false - v6 = true - } else { - v4 = true - v6 = false - } - if err := bindInterface(fd, bindInterfaceIndex, v4, v6); err != nil { - log.Println("underlyingNetDialer: bind interface", network, address, err) - } - } - }) - return nil - }, - } - // - updateRoutes() - iphlpapi.RegisterNotifyRouteChange2(func(callerContext uintptr, row uintptr, notificationType uint32) uintptr { - updateRoutes() - return 0 - }, false) -} - -func updateRoutes() { - lock.Lock() - defer lock.Unlock() - - var err error - routes, err = iphlpapi.GetRoutes() - if err != nil { - log.Println("warning: GetRoutes failed", err) - } - interfaces, err = net.Interfaces() - if err != nil { - log.Println("warning: Interfaces failed", err) - } -} - -func getBindInterfaceIndex(address string) uint32 { - host, _, _ := net.SplitHostPort(address) - if net.ParseIP(host).IsLoopback() { - return 0 - } - - lock.Lock() - defer lock.Unlock() - - if interfaces == nil { - log.Println("warning: no interfaces info") - return 0 - } - - var nextInterface int - for i, intf := range interfaces { - if intf.Name == "nekoray-tun" { - if len(interfaces) > i+1 { - nextInterface = interfaces[i+1].Index - } - break - } - } - - // Not in Tun Mode - if nextInterface == 0 { - return 0 - } - - if routes == nil { - log.Println("warning: no routes info") - return 0 - } - - for _, route := range routes { - // MIB_IPROUTE_TYPE_INDIRECT - if route.ForwardType == 4 { - // MIB_IPPROTO_NETMGMT - if route.ForwardProto == 3 { - if route.GetForwardMask().IsUnspecified() { - return route.ForwardIfIndex - } - } - } - } - - // Default route not found - return uint32(nextInterface) -} - -const ( - IP_UNICAST_IF = 31 // nolint: golint,stylecheck - IPV6_UNICAST_IF = 31 // nolint: golint,stylecheck -) - -func bindInterface(fd uintptr, interfaceIndex uint32, v4, v6 bool) error { - if v4 { - /* MSDN says for IPv4 this needs to be in net byte order, so that it's like an IP address with leading zeros. */ - bytes := make([]byte, 4) - binary.BigEndian.PutUint32(bytes, interfaceIndex) - interfaceIndex_v4 := *(*uint32)(unsafe.Pointer(&bytes[0])) - - if err := syscall.SetsockoptInt(syscall.Handle(fd), syscall.IPPROTO_IP, IP_UNICAST_IF, int(interfaceIndex_v4)); err != nil { - return err - } - } - - if v6 { - if err := syscall.SetsockoptInt(syscall.Handle(fd), syscall.IPPROTO_IPV6, IPV6_UNICAST_IF, int(interfaceIndex)); err != nil { - return err - } - } - - return nil -} diff --git a/go/cmd/nekoray_core/protect_fwmark_linux.go b/go/cmd/nekoray_core/protect_fwmark_linux.go deleted file mode 100644 index 0da36bb..0000000 --- a/go/cmd/nekoray_core/protect_fwmark_linux.go +++ /dev/null @@ -1,125 +0,0 @@ -package main - -import ( - "fmt" - "log" - "net" - "strings" - "syscall" - - "github.com/jsimonetti/rtnetlink" - "github.com/xtls/xray-core/transport/internet" - linuxcap "kernel.org/pub/linux/libs/security/libcap/cap" -) - -var rtnetlink_conn *rtnetlink.Conn -var cap_net_admin = 0 - -func nekorayLinuxProtect(fd int) bool { - if cap_net_admin == 0 { - str := strings.ToLower(linuxcap.GetProc().String()) - if strings.Contains(str, "cap_net_admin") || str == "=ep" { - cap_net_admin = 1 - } else { - cap_net_admin = -1 - } - } - - // check is in Tun Mode - if is_fwmark_exist(514) { - if cap_net_admin == 1 { - // have permission - if err := syscall.SetsockoptInt(fd, syscall.SOL_SOCKET, syscall.SO_MARK, 514); err != nil { - log.Println("syscall.SetsockoptInt:", err) - return false - } - } else { - // don't have permission - if err := cmsgProtect(fd, "./protect"); err != nil { - log.Println("cmsgProtect:", err) - return false - } - } - } - return true -} - -func cmsgProtect(fd int, unixPath string) error { - socket, err := syscall.Socket(syscall.AF_UNIX, syscall.SOCK_STREAM, 0) - if err != nil { - return err - } - defer syscall.Close(socket) - - syscall.SetsockoptTimeval(socket, syscall.SOL_SOCKET, syscall.SO_RCVTIMEO, &syscall.Timeval{Sec: 3}) - syscall.SetsockoptTimeval(socket, syscall.SOL_SOCKET, syscall.SO_SNDTIMEO, &syscall.Timeval{Sec: 3}) - - err = syscall.Connect(socket, &syscall.SockaddrUnix{Name: unixPath}) - if err != nil { - return err - } - - err = syscall.Sendmsg(socket, nil, syscall.UnixRights(fd), nil, 0) - if err != nil { - return err - } - - dummy := []byte{1} - n, err := syscall.Read(socket, dummy) - if err != nil { - return err - } - if n != 1 { - return fmt.Errorf("cmsgProtect protect failed") - } - return nil -} - -func is_fwmark_exist(number int) bool { - var err error - - if rtnetlink_conn == nil { - rtnetlink_conn, err = rtnetlink.Dial(nil) - if err != nil { - log.Println(err) - } - return false - } - - rules, err := rtnetlink_conn.Rule.List() - if err != nil { - rtnetlink_conn = nil - return false - } - - for _, rule := range rules { - if rule.Attributes != nil && rule.Attributes.FwMark != nil && uint32(number) == *rule.Attributes.FwMark { - return true - } - } - - return false -} - -func init() { - internet.RegisterListenerController(func(network, address string, conn syscall.RawConn) error { - conn.Control(func(fd uintptr) { - nekorayLinuxProtect(int(fd)) - }) - return nil - }) - internet.RegisterDialerController(func(network, address string, conn syscall.RawConn) error { - conn.Control(func(fd uintptr) { - nekorayLinuxProtect(int(fd)) - }) - return nil - }) - underlyingNetDialer = &net.Dialer{ - Control: func(network, address string, c syscall.RawConn) error { - c.Control(func(fd uintptr) { - nekorayLinuxProtect(int(fd)) - }) - return nil - }, - } -} diff --git a/go/cmd/nekoray_core/toolbox_linux.go b/go/cmd/nekoray_core/toolbox_linux.go deleted file mode 100644 index 19fc333..0000000 --- a/go/cmd/nekoray_core/toolbox_linux.go +++ /dev/null @@ -1,91 +0,0 @@ -package main - -import ( - "flag" - "io" - "log" - "net" - "net/http" - "os" - "syscall" - - "github.com/jsimonetti/rtnetlink" - linuxcap "kernel.org/pub/linux/libs/security/libcap/cap" -) - -func ToolBox() { - // - var protectListenPath string - var protectFwMark int - // - flag.StringVar(&protectListenPath, "protect-listen-path", "", "Set unix protect server listen path (Linux ROOT only)") - flag.IntVar(&protectFwMark, "protect-fwmark", 0, "Set unix protect fwmark (Linux ROOT only)") - flag.CommandLine.Parse(os.Args[3:]) - // - switch os.Args[2] { - case "rule": - { - // Dial a connection to the rtnetlink socket - conn, err := rtnetlink.Dial(nil) - if err != nil { - log.Fatal(err) - } - defer conn.Close() - - // Request a list of rules - rules, err := conn.Rule.List() - if err != nil { - log.Fatal(err) - } - - for _, rule := range rules { - log.Printf("%+v", rule) - log.Printf("%+v", rule.Attributes) - } - - for _, rule := range rules { - if rule.Attributes.FwMark != nil { - log.Printf("%+v", rule.Attributes) - log.Println(*rule.Attributes.FwMark, *rule.Attributes.Table) - } - } - } - case "cap": - { - set := linuxcap.GetProc() - if set != nil { - log.Println(set) - } - } - // case "protect": - // { - // if protectListenPath == "" { - // log.Println("missing protect-listen-path") - // return - // } - // protect_server.ServeProtect(protectListenPath, protectFwMark) - // } - case "btd": // Test the permission - { - d := &net.Dialer{ - Control: func(network, address string, c syscall.RawConn) (err error) { - c.Control(func(fd uintptr) { - err = syscall.BindToDevice(int(fd), os.Args[3]) - }) - return - }, - } - c := http.Client{ - Transport: &http.Transport{ - DialContext: d.DialContext, - }, - } - resp, err := c.Get(os.Args[4]) - if err != nil { - log.Fatalln(err) - } - io.Copy(os.Stdout, resp.Body) - resp.Body.Close() - } - } -} diff --git a/go/cmd/nekoray_core/toolbox_other.go b/go/cmd/nekoray_core/toolbox_other.go deleted file mode 100644 index b155827..0000000 --- a/go/cmd/nekoray_core/toolbox_other.go +++ /dev/null @@ -1,6 +0,0 @@ -//go:build !windows && !linux - -package main - -func ToolBox() { -} diff --git a/go/cmd/nekoray_core/toolbox_windows.go b/go/cmd/nekoray_core/toolbox_windows.go deleted file mode 100644 index a3bc864..0000000 --- a/go/cmd/nekoray_core/toolbox_windows.go +++ /dev/null @@ -1,27 +0,0 @@ -package main - -import ( - "log" - "net" - "os" -) - -func ToolBox() { - switch os.Args[2] { - case "if": - { - intfs, err := net.Interfaces() - if err != nil { - log.Fatalln(err) - } - for _, intf := range intfs { - log.Println(intf) - } - for _, route := range routes { - log.Println(route) - } - log.Println("TUN:", getNekorayTunIndex()) - log.Println("Upstream:", getBindInterfaceIndex("8.8.8.8:8888")) - } - } -} diff --git a/go/grpc_server/grpc.go b/go/grpc_server/grpc.go index 772dd60..210f780 100644 --- a/go/grpc_server/grpc.go +++ b/go/grpc_server/grpc.go @@ -94,10 +94,7 @@ func RunCore(setupCore func(), server gen.LibcoreServiceServer) { ) gen.RegisterLibcoreServiceServer(s, server) - name := "nekoray_core" - if neko_common.RunMode == neko_common.RunMode_NekoBox_Core { - name = "nekobox_core" - } + name := "nekobox_core" log.Printf("%s grpc server listening at %v\n", name, lis.Addr()) if err := s.Serve(lis); err != nil { diff --git a/libs/build_go.sh b/libs/build_go.sh index 4705fa4..45a76e8 100755 --- a/libs/build_go.sh +++ b/libs/build_go.sh @@ -6,8 +6,6 @@ source libs/env_deploy.sh [ "$GOOS" == "windows" ] && [ "$GOARCH" == "arm64" ] && DEST=$DEPLOYMENT/windows-arm64 || true [ "$GOOS" == "linux" ] && [ "$GOARCH" == "amd64" ] && DEST=$DEPLOYMENT/linux64 || true [ "$GOOS" == "linux" ] && [ "$GOARCH" == "arm64" ] && DEST=$DEPLOYMENT/linux-arm64 || true -[ "$GOOS" == "darwin" ] && [ "$GOARCH" == "amd64" ] && DEST=$DEPLOYMENT/macos-amd64 || true -[ "$GOOS" == "darwin" ] && [ "$GOARCH" == "arm64" ] && DEST=$DEPLOYMENT/macos-arm64 || true if [ -z $DEST ]; then echo "Please set GOOS GOARCH" exit 1 @@ -23,15 +21,6 @@ pushd go/cmd/updater [ "$GOOS" == "linux" ] && mv $DEST/updater $DEST/launcher || true popd -#### Go: nekoray_core #### -neko_common="github.com/matsuridayo/libneko/neko_common" -pushd ../Xray-core -Version_Xray=$(git log --pretty=format:'%h' -n 1) -popd -pushd go/cmd/nekoray_core -go build -v -o $DEST -trimpath -ldflags "-w -s -X $neko_common.Version_v2ray=$Version_Xray -X $neko_common.Version_neko=$version_standalone" -popd - #### Go: nekobox_core #### pushd go/cmd/nekobox_core go build -v -o $DEST -trimpath -ldflags "-w -s -X $neko_common.Version_neko=$version_standalone" -tags "with_clash_api,with_gvisor,with_quic,with_wireguard,with_utls,with_ech" diff --git a/libs/deploy_macos.sh b/libs/deploy_macos.sh deleted file mode 100755 index 7e9febf..0000000 --- a/libs/deploy_macos.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -set -e - -if [[ $(uname -m) == 'arm64' ]]; then - ARCH="arm64" -else - ARCH="amd64" -fi - -source libs/env_deploy.sh -DEST=$DEPLOYMENT/macos-$ARCH -rm -rf $DEST -mkdir -p $DEST - -#### copy golang & public_res => .app #### -pushd download-artifact -find . -name artifacts.tgz | xargs -n1 tar xvzf -mv deployment/public_res/* deployment/macos-$ARCH -mv deployment/macos-$ARCH/* $BUILD/nekoray.app/Contents/MacOS -popd - -#### deploy qt & DLL runtime => .app #### -pushd $BUILD -macdeployqt nekoray.app -verbose=3 -popd - -#### pack dmg ### -sudo npm install -g appdmg -appdmg appdmg.json $DEST/nekoray.dmg diff --git a/libs/get_source.sh b/libs/get_source.sh index 7d302dd..a449f8e 100755 --- a/libs/get_source.sh +++ b/libs/get_source.sh @@ -18,13 +18,6 @@ source $SRC_ROOT/libs/get_source_env.sh NO_ENV=1 ./libs/get_source.sh popd - #### -if [ ! -d "Xray-core" ]; then - git clone --no-checkout https://github.com/MatsuriDayo/Xray-core.git -fi -pushd Xray-core -git checkout "$COMMIT_MATSURI_XRAY" -popd popd diff --git a/libs/get_source_env.sh b/libs/get_source_env.sh index 533d969..c27535e 100644 --- a/libs/get_source_env.sh +++ b/libs/get_source_env.sh @@ -1,6 +1,5 @@ if [ ! -z $ENV_NEKORAY ]; then export COMMIT_SING_BOX_EXTRA="d31d6da26a51a929349e0d75fd89dccbe20d1268" - export COMMIT_MATSURI_XRAY="01208225ee7e508044cca8eb6776a117bcecd997" fi if [ ! -z $ENV_SING_BOX_EXTRA ]; then diff --git a/libs/package_debian.sh b/libs/package_debian.sh index ff44ff3..d1b7eaf 100644 --- a/libs/package_debian.sh +++ b/libs/package_debian.sh @@ -24,7 +24,7 @@ if [ ! -s /usr/share/applications/nekoray.desktop ]; then cat >/usr/share/applications/nekoray.desktop<<-END [Desktop Entry] Name=nekoray -Comment=Qt based cross-platform GUI proxy configuration manager (backend: Xray / sing-box) +Comment=Qt based cross-platform GUI proxy configuration manager (backend: sing-box) Exec=sh -c "PATH=/opt/nekoray:\$PATH /opt/nekoray/nekoray -appdata" Icon=/opt/nekoray/nekoray.png Terminal=false diff --git a/main/QJS.cpp b/main/QJS.cpp deleted file mode 100644 index b5ee85e..0000000 --- a/main/QJS.cpp +++ /dev/null @@ -1,148 +0,0 @@ -#include "QJS.hpp" - -#ifdef _MSC_VER -#define JS_STRICT_NAN_BOXING -#endif - -#include "3rdparty/qjs/nekoray_qjs.h" -#include "main/NekoGui.hpp" - -namespace qjs { -#ifndef NKR_NO_QUICKJS - namespace exception { - static void js_dump_obj(JSContext *ctx, QString &out, JSValueConst val) { - const char *str; - - str = JS_ToCString(ctx, val); - if (str) { - out.append(str); - out.append('\n'); - JS_FreeCString(ctx, str); - } else { - out += "[exception]\n"; - } - } - - static void js_std_dump_error1(JSContext *ctx, QString &out, JSValueConst exception_val) { - JSValue val; - auto is_error = JS_IsError(ctx, exception_val); - js_dump_obj(ctx, out, exception_val); - if (is_error) { - val = JS_GetPropertyStr(ctx, exception_val, "stack"); - if (!JS_IsUndefined(val)) { - js_dump_obj(ctx, out, val); - } - JS_FreeValue(ctx, val); - } - } - - QString js_std_dump_error(JSContext *ctx) { - QString result; - JSValue exception_val; - - exception_val = JS_GetException(ctx); - js_std_dump_error1(ctx, result, exception_val); - JS_FreeValue(ctx, exception_val); - - return result; - } - } // namespace exception - - JSValue func_log(JSContext *ctx, JSValue this_val, int argc, JSValue *argv) { - QString qString; - - int i; - const char *str; - size_t len; - - for (i = 0; i < argc; i++) { - if (i != 0) qString.append(' '); - str = JS_ToCStringLen(ctx, &len, argv[i]); - if (!str) - return JS_EXCEPTION; - qString.append(str); - JS_FreeCString(ctx, str); - } - - MW_show_log(qString); - qDebug() << "func_log:" << qString; - - return JS_UNDEFINED; - } -#endif - -#define NEKO_CTX ((nekoray_qjs_context *) this->neko_ctx) - - QJS::QJS() { -#ifndef NKR_NO_QUICKJS - MW_show_log("loading quickjs......"); - // - this->neko_ctx = malloc(sizeof(nekoray_qjs_context)); - nekoray_qjs_new_arg arg; - arg.neko_ctx = NEKO_CTX; - arg.enable_std = NekoGui::dataStore->enable_js_hook == 2 ? 1 : 0; - arg.func_log = func_log; - nekoray_qjs_new(arg); -#endif - } - - QJS::QJS(const QByteArray &jsSource) : QJS() { - this->Eval(jsSource); - } - - QJS::~QJS() { -#ifndef NKR_NO_QUICKJS - nekoray_qjs_free(NEKO_CTX); - free(this->neko_ctx); -#endif - } - - QString QJS::Eval(const QByteArray &jsSource) const { -#ifndef NKR_NO_QUICKJS - auto result = nekoray_qjs_eval(NEKO_CTX, jsSource.data(), jsSource.length()); - if (JS_IsException(result)) { - MW_show_log(exception::js_std_dump_error(NEKO_CTX->ctx)); - return {}; - } - auto cString = JS_ToCString(NEKO_CTX->ctx, result); - QString qString(cString); - JS_FreeCString(NEKO_CTX->ctx, cString); - JS_FreeValue(NEKO_CTX->ctx, result); - return qString; -#else - return {}; -#endif - } - - QString QJS::Eval(const QString &jsSource) const { - return this->Eval(jsSource.toUtf8()); - } - - QString QJS::EvalFile(const QString &jsPath) const { - return this->Eval(ReadFile(jsPath)); - } - - QString QJS::EvalFunction(const QString &funcName, const QString &arg) const { -#ifndef NKR_NO_QUICKJS - auto ba1 = arg.toUtf8(); - JSValue globalObj = JS_GetGlobalObject(NEKO_CTX->ctx); - JSValue tempObj = JS_NewStringLen(NEKO_CTX->ctx, ba1.data(), ba1.length()); - JS_SetPropertyStr(NEKO_CTX->ctx, globalObj, "tempObj", tempObj); - auto result = this->Eval(QString("%1(tempObj)").arg(funcName)); - JS_DeleteProperty(NEKO_CTX->ctx, globalObj, JS_NewAtom(NEKO_CTX->ctx, "tempObj"), 1); // Free tempObj - JS_FreeValue(NEKO_CTX->ctx, globalObj); - return result; -#else - return {}; -#endif - } - - QByteArray ReadHookJS() { -#ifndef NKR_NO_QUICKJS - if (NekoGui::dataStore->enable_js_hook > 0) { - return ReadFile(QString("./hook.%1.js").arg(software_name.toLower())); - } -#endif - return {}; - } -} // namespace qjs diff --git a/main/QJS.hpp b/main/QJS.hpp deleted file mode 100644 index 34e39b3..0000000 --- a/main/QJS.hpp +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -class QByteArray; -class QString; - -namespace qjs { - class QJS { - public: - QJS(); - explicit QJS(const QByteArray &jsSource); - ~QJS(); - - QString Eval(const QByteArray &jsSource) const; - QString Eval(const QString &jsSource) const; - QString EvalFile(const QString &jsPath) const; - QString EvalFunction(const QString &funcName, const QString &arg) const; - - private: - void *neko_ctx; - }; - - QByteArray ReadHookJS(); -} // namespace qjs diff --git a/res/MacOSXBundleInfo.plist b/res/MacOSXBundleInfo.plist deleted file mode 100644 index e06b17e..0000000 --- a/res/MacOSXBundleInfo.plist +++ /dev/null @@ -1,38 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${MACOSX_BUNDLE_EXECUTABLE_NAME} - CFBundleGetInfoString - ${MACOSX_BUNDLE_INFO_STRING} - CFBundleIconFile - ${MACOSX_BUNDLE_ICON_FILE} - CFBundleIdentifier - ${MACOSX_BUNDLE_GUI_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleLongVersionString - ${MACOSX_BUNDLE_LONG_VERSION_STRING} - CFBundleName - ${MACOSX_BUNDLE_BUNDLE_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - ${MACOSX_BUNDLE_SHORT_VERSION_STRING} - CFBundleSignature - ???? - CFBundleVersion - ${MACOSX_BUNDLE_BUNDLE_VERSION} - CSResourcesFileMapped - - NSHumanReadableCopyright - ${MACOSX_BUNDLE_COPYRIGHT} - NSPrincipalClass - NSApplication - NSHighResolutionCapable - True - - diff --git a/sub/GroupUpdater.cpp b/sub/GroupUpdater.cpp index 4a68dfb..ef3b227 100644 --- a/sub/GroupUpdater.cpp +++ b/sub/GroupUpdater.cpp @@ -1,7 +1,6 @@ #include "db/ProfileFilter.hpp" #include "fmt/includes.h" #include "fmt/Preset.hpp" -#include "main/QJS.hpp" #include "main/HTTPRequestHelper.hpp" #include "GroupUpdater.hpp" @@ -593,17 +592,6 @@ namespace NekoGui_sub { } } - // hook.js - auto source = qjs::ReadHookJS(); - if (!source.isEmpty()) { - qjs::QJS js(source); - auto js_result = js.EvalFunction("hook.hook_import", content); - if (content != js_result) { - MW_show_log("hook.js modified your import content."); - content = js_result; - } - } - // 解析并添加 profile rawUpdater->update(content);