lilendian0x00 / xray-knife

A swiss army knife for xray-core to do task such as parsing xray config links, batch testing (latency, speedtest), socks proxy client, etc
MIT License
126 stars 18 forks source link

Speedtest of a config #2

Closed just1random closed 9 months ago

just1random commented 9 months ago

Greetings and thank you for your efforts in this project.

Could you please clarify if there's an option to conduct a speed test on a configuration? I noticed a screenshot in the README showing batch testing of configuration files, but I couldn't locate a specific option for a speed test. Additionally, which version of Xray is currently in use? Is there a way to select a specific version or provide a path to a core? Lastly, is it feasible to input configurations from a file rather than through STDIN?

just1random commented 9 months ago

Okay, By using the --flags option, I was able to discover the other options available. Now, I just need to determine the xray-core version. Could you please help me with this?

For anyone else wondering:

xray-knife net http
Flags:
  -a, --amount uint32   Download and upload amount (KB) (default 10000)
  -b, --body            Show response body
  -c, --config string   The xray config link
  -f, --file string     Read config links from a file
  -h, --help            help for http
  -e, --insecure        Insecure tls connection (fake SNI)
  -d, --mdelay uint16   Maximum allowed delay (default 10000)
  -m, --method string   Http method (default "GET")
  -o, --out string      Output file for valid config links (default "valid.txt")
  -r, --rip             Send request to XXXX/cdn-cgi/trace to receive config's IP details
  -s, --sort            Sort config links by their delay (fast to slow) (default true)
  -p, --speedtest       Speed test with speed.cloudflare.com
  -t, --thread uint16   Number of threads to be used for checking links from file (default 5)
  -x, --type string     Output type (csv, txt) (default "txt")
  -u, --url string      The url to test config (default "https://google.com/")
  -v, --verbose         Verbose xray-core
lilendian0x00 commented 9 months ago

Hello, it's my honor

Yes, using the -p flag for net http command you can do speedtest. Also consider setting the output to csv file using -x csv flag in case you want to see the speedtest results in detail.

And also you can use, -f flag to pass batch of configs.

The software doesn't use xray-core binary. It uses its package directly and you can change its version inside go.mod file but you have to compile the source code yourself using the go build . command.

just1random commented 9 months ago

This tool is very well thought out and well written. Thank you for your response.

lilendian0x00 commented 9 months ago

I'm really happy and honored to hear that. Anytime!

elegance666 commented 3 weeks ago

what is default name of -f file?