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

Methods docs and synchronization #40

Open
evgenybozhko2 opened this issue Nov 20, 2024 · 2 comments
Open

Methods docs and synchronization #40

evgenybozhko2 opened this issue Nov 20, 2024 · 2 comments

Comments

@evgenybozhko2
Copy link

Hi man, thank you for this useful library. I can't understand why there needed a json() and test() methods, what they return?
Also I see that the x-ray core to be ready for using should wait some times. the start() method is not synchronized, and we can't understand exactly time when the x-ray ready to use. Or maybe some callback onConnected(). Does it possible to make that?

@SaeedDev94
Copy link
Owner

test method validates the json config, it's same as xray run -test -c config.json in cli version, I want to make sure the user config is valid
json method parses link config (ex vless://xxx) to a simple json config
for start method actually it doesn't matter when it will be ready as it's working correctly
BTW it's not a library =)

@evgenybozhko2
Copy link
Author

evgenybozhko2 commented Nov 20, 2024

for start method actually it doesn't matter when it will be ready as it's working correctly

If I do a request exactly after call the start method. I have got an exception and something like that.
[javax.net.ssl.SSLHandshakeException: Connection closed by peer at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)]

But if I do a delay(2000) it works as expected. Do you know what Is the issue?

So I need to know how much time I should wait before executing the first request. For slow phones, it's 2 sec, for faster about 1sec. But the perfect way, will be has the possibility to know when exactly the x-ray is ready to use.

Best regards,
Thanks

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

No branches or pull requests

2 participants