Qv2ray
Qv2ray copied to clipboard
add trojan link & outbound support
The v2ray-core supports the trojan editor now, this PR makes qv2ray can edit trojan outbounds, with simple link formatting.
with this PR merged, can we fully sunset the Trojan plugin? If so, users have to disable that manually.
As far as I can remember, the default port value should be zero or it would be "shaken" as if no port is specified. For share link part, you may want to take a look at https://github.com/Qv2ray/QvPlugin-Trojan/issues/18. It's better to use QUrl rather than parsing manually. TLS should be madatory but the code seems to be importing a cleartext (security type none) config.
Defaulting the port to 443, and then use A(port)
instead of F(..., port)
in the JSONSTRUCT_REGISTER
macro would do the trick :)
Yes, switching to QUrl is always a better idea.
I'm not familiar with share links, is trojan://p@ss:ω[email protected]:443#evil
a valid share link? As in the docmument, the password can be any string. The above url seems cannot be correctly parsed by QUrl. Can we tolerate with this type of misbehavior?
Defaulting the port to 443, and then use
A(port)
instead ofF(..., port)
in theJSONSTRUCT_REGISTER
macro would do the trick :)
Did you mean changing code to the following, iiuc?
int port = 443;
JSONSTRUCT_COMPARE(TrojanServerObject, address, password)
JSONSTRUCT_REGISTER(TrojanServerObject, A(port), F(address, password))