2dust / v2rayNG

A V2Ray client for Android, support Xray core and v2fly core
https://1.2345345.xyz
GNU General Public License v3.0
31.36k stars 4.81k forks source link

[Enhancement] Better vpn service creation #3076

Closed X-Oracle closed 4 weeks ago

X-Oracle commented 4 weeks ago

If we have 2 clients running some inbounds that has same port, v2rayng won't start cause x-ray panics.

V2rayng seems to first create x-ray service then create VPN service. Which is fine in most cases, but if we have a vpn client for example a Sing box or a cloned version of v2rayng which is already running and occupying same ports, it won't stop the other vpn services thus fails to run.

My suggestion is that v2rayng tries to close vpn service if it is activated by other softwares.

In this case we can make sure x-ray won't panic because of an occupied port.

Good luck,