Xray online config validator (Xray in WASM!) #3779
mmmray
started this conversation in
Show and tell
Replies: 1 comment
|
Cool project. I've actually been working on something similar lately while working on Marz, I put together an Xray config validator, but not using WASM (at least not for now). Instead, I'm defining the config as a Zod schema to get full TypeScript type safety. Using Zod v4, I was able to generate a docs-integrated JSON schema for Xray configs that can be used for editor autocomplete: https://gozargah.github.io/xray-schema/ I also added some utilities around it, like link parsing/generation. The repo is here: https://github.com/Gozargah/xray-schema I'm thinking about getting to 100% confidence on validation, and it might be worth cross-validating configs against a WASM build of Xray config too. Nice idea overall. Awesome work. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
https://mmmray.github.io/xray-online/ is a tool to parse and validate Xray configuration.
Many people are writing JSON config in various clients and panels. When mistakes happen, often the error message in some GUI just says "Invalid config" or even better, "core restarting". So, here's a tool that lets you find mistakes early, beyond just some JSON syntax errors, without the need to download and run the core from console.
The tool runs entirely in the browser and doesn't send any input anywhere. Xray's
conf/inframodule and its dependencies are compiled to WASM. geosite.dat and geoip.dat are taken from v2fly and embedded into the website as well.I had to fork xray so that it can be compiled to WASM. The patchset is a bit unelegant and should not be merged upstream, and it's easy to maintain separately. Maybe one day I figure out a way to refactor config in such a way that doesn't require a lot of
go:buildcomments.Sourcecode here: https://github.com/mmmray/xray-online -- feedback welcome
All reactions