Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add trojan link & outbound support #1684

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

dwuggh
Copy link

@dwuggh dwuggh commented Nov 22, 2022

The v2ray-core supports the trojan editor now, this PR makes qv2ray can edit trojan outbounds, with simple link formatting.

Copy link
Member

@moodyhunter moodyhunter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the contribution anyway, only one tiny default value could be refined :)

src/plugins/common/CommonTypes.hpp Outdated Show resolved Hide resolved
@moodyhunter
Copy link
Member

with this PR merged, can we fully sunset the Trojan plugin?
If so, users have to disable that manually.

@dyhkwong
Copy link
Contributor

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 Qv2ray/QvPlugin-Trojan#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.

@moodyhunter
Copy link
Member

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.

@dwuggh
Copy link
Author

dwuggh commented Nov 23, 2022

I'm not familiar with share links, is trojan://p@ss:ω0rd@4.4.4.4: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?

@dwuggh
Copy link
Author

dwuggh commented Nov 23, 2022

Defaulting the port to 443, and then use A(port) instead of F(..., port) in the JSONSTRUCT_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))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants