Git Product home page Git Product logo

Comments (10)

DrBrad avatar DrBrad commented on August 10, 2024

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

from android-vpn-to-socket.

DrBrad avatar DrBrad commented on August 10, 2024

Proxy.java

from android-vpn-to-socket.

ubeyid avatar ubeyid commented on August 10, 2024

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.

from android-vpn-to-socket.

ubeyid avatar ubeyid commented on August 10, 2024

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!!

from android-vpn-to-socket.

DrBrad avatar DrBrad commented on August 10, 2024

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?

from android-vpn-to-socket.

ubeyid avatar ubeyid commented on August 10, 2024

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 !!!

from android-vpn-to-socket.

DrBrad avatar DrBrad commented on August 10, 2024

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

from android-vpn-to-socket.

DrBrad avatar DrBrad commented on August 10, 2024

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

from android-vpn-to-socket.

ubeyid avatar ubeyid commented on August 10, 2024

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());

from android-vpn-to-socket.

ubeyid avatar ubeyid commented on August 10, 2024

İ 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

from android-vpn-to-socket.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.