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

Problem on android 11 #2

Closed
ubeyid opened this issue May 9, 2022 · 10 comments
Closed

Problem on android 11 #2

ubeyid opened this issue May 9, 2022 · 10 comments

Comments

@ubeyid
Copy link

ubeyid commented May 9, 2022

It doesn't work on android 11 it makes internet connection so slow when I activate exception and look in android studio logs it always says read socket timeout exception!!

@DrBrad
Copy link
Owner

DrBrad commented May 9, 2022

Do you mind expanding a little bit. This is android to socket you define where the socket leads.

@DrBrad
Copy link
Owner

DrBrad commented May 9, 2022

Proxy.java

@ubeyid
Copy link
Author

ubeyid commented May 9, 2022

Problem is on Proxy.java class where you read data from the server! It waits to read data from server for long time but it doesn't success and it throws SocketReadTimeoutException.

@ubeyid
Copy link
Author

ubeyid commented May 9, 2022

Your code is great and understandable 👏👏👏 .Is it possible that you have a problem with ip headers you didnt set cheksum and change the length of the data in ipheaders Or you think these fields are not important? I have no so much info about ip packets!!

@DrBrad
Copy link
Owner

DrBrad commented May 9, 2022

It would surprise me if the issue pertained to any of the headers, however its possible. I would guess still that its somewhere in the proxy.java.

Would you be willing to post the error log?

@ubeyid
Copy link
Author

ubeyid commented May 9, 2022

When you route only one ip address .addRoute("194.163.43.216",32) and remove .addRoute("0.0.0.0",0) it works perfectly. So I think problem is service.protect(server) in first thread it protect the server but in second and in the other thread server connection it cannot protect new server connections so problem begins here it waits for long time to connect server and then it throws SocketReadTimeOutException !!!

@DrBrad
Copy link
Owner

DrBrad commented May 9, 2022

Maybe we need to protect after the connect on Proxy.java?

@DrBrad
Copy link
Owner

DrBrad commented May 9, 2022

That or it may be an issue with bad passing of the intent?

@ubeyid
Copy link
Author

ubeyid commented May 9, 2022

Try to protect serverSocket in the below part not the server in multiple thread!!! I will try it tomorrow!

Socket socket;
ServerSocket serverSocket = new ServerSocket(port);
port = (short) (serverSocket.getLocalPort() & 0xFFFF);
Log.e("info", "VPNtoSocket VPN started on port: "+serverSocket.getLocalPort());

@ubeyid
Copy link
Author

ubeyid commented May 10, 2022

İ made some modification on Proxy.java and VPNService.java and NatSession.java and a little bit more on the remaining code and now it works perfectly !!! Project links is https://github.com/ubeyid/Android-VpnSocket-VpnProxy

@ubeyid ubeyid closed this as completed May 10, 2022
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