Изменения Xray-core
RayRay построен на Xray-core (лицензия MPL-2.0). В приложении Xray-core 26.11.9 (модуль Go github.com/xtls/xray-core v1.260327.1-0.20261109052709-676eaf66f8f0, коммит 676eaf66f8f0) с изменениями RayRay: три общих для iOS и Android и одно только для Android. Патчи ниже — для RayRay 1.1.4. Исходный код изменённых файлов — в этих патчах, они накладываются командой patch -p1 в папке Xray-core:
- xray-tun-memory.patch — меньше памяти в TUN-стеке на iOS: TCP-окно 64 КБ, ограничение числа TCP-соединений и UDP-потоков, очередь UDP-пакетов короче; если новые соединения отклоняются дольше 5 секунд, самое тихое закрывается.
- xray-socks-udp-in-tcp.patch — SOCKS-вход принимает UDP внутри TCP-соединения с паролем, поэтому RayRay не открывает UDP-порт для других приложений.
- xray-ios-fixes.patch — исправления: выбранное значение Mux сохраняется, ошибка в данных сервера не приводит к падению, клиенты XHTTP и gRPC освобождаются при остановке, буфер определения протокола 8 КБ, клиент realm связывается со своим сервером так же, как подключается его исходящее соединение.
- xray-android-fixes.patch — только для Android, накладывается после трёх патчей выше: ограничения памяти TUN-стека действуют и на Android; локальный DNS Xray пользуется системным резолвером; HTTP-запросы realm идут мимо туннеля приложения; без splice, как на iOS, чтобы счётчики трафика обновлялись сразу; соединения пинга мимо прокси (
sockopt.interface«rayray-bypass») привязываются к сети устройства самим приложением.
В RayRay 1.1.3 то же ядро, но более ранние версии двух патчей: xray-ios-fixes.patch (без связи клиента realm через исходящее соединение) и xray-android-fixes.patch (без привязки соединений «rayray-bypass»). xray-tun-memory.patch и xray-socks-udp-in-tcp.patch в 1.1.3 те же.
Эти файлы распространяются по лицензии MPL-2.0, как и весь Xray-core.
Xray-core changes
RayRay is built on Xray-core (MPL-2.0 license). The app contains Xray-core 26.11.9 (Go module github.com/xtls/xray-core v1.260327.1-0.20261109052709-676eaf66f8f0, commit 676eaf66f8f0) with RayRay changes: three shared by iOS and Android and one for Android only. The patches below are for RayRay 1.1.4. The source code of the changed files is in these patches, applied with patch -p1 in the Xray-core folder:
- xray-tun-memory.patch — less memory in the TUN stack on iOS: a 64 KB TCP window, a cap on TCP connections and UDP flows, and a shorter UDP packet queue; when new connections have been refused for over 5 seconds, the quietest one is closed.
- xray-socks-udp-in-tcp.patch — the SOCKS inbound takes UDP inside the password-checked TCP connection, so RayRay opens no UDP port for other apps.
- xray-ios-fixes.patch — fixes: the chosen Mux value is kept, bad server data no longer causes a crash, XHTTP and gRPC clients are released when Xray stops, an 8 KB sniff buffer, and a realm client reaches its server the way its outbound connects.
- xray-android-fixes.patch — Android only, applied after the three patches above: the TUN stack memory limits apply on Android too; Xray’s local DNS uses the system resolver; realm’s HTTP requests bypass the app’s own tunnel; no splice, as on iOS, so the traffic counters update at once; the connections of a ping past the proxy (
sockopt.interface“rayray-bypass”) are bound to the device’s network by the app itself.
RayRay 1.1.3 has the same core but earlier versions of two patches: xray-ios-fixes.patch (without the realm client reaching its server through the outbound) and xray-android-fixes.patch (without binding the “rayray-bypass” connections). xray-tun-memory.patch and xray-socks-udp-in-tcp.patch are the same in 1.1.3.
These files are available under the MPL-2.0 license, like all of Xray-core.