DrBrad / JTun2Socks

This works similar to network layer socks client, written completely in java.
MIT License
24 stars 7 forks source link

Build failed due to client inputstream #2

Open PayaMousavi opened 2 years ago

PayaMousavi commented 2 years ago

Hey, you did a amazing job created android socks5 client in java! i want to use it but i get this error while building in android studio:

/home/paya/AndroidStudioProjects/JTun2Socks/app/src/main/java/jtun2socks/shadowrouter/org/jtun2socks/VPN/Proxy.java:55: error: cannot find symbol
                    clientIn = socket.getInputStream();
                    ^
  symbol:   variable clientIn
  location: class Proxy.Tunnel

i wasn't able to fix it(did build but doesn't connect) so if u could fix it and push update it would be really helpful

DrBrad commented 2 years ago

Should be fixed now, under proxy.java is where you set your socks IP and Port.

PayaMousavi commented 2 years ago

thanks for the fix! but it just got more confusing is this app even work? it managed to connect to socks5 server but opening a site like https://checkip.amazonaws.com/ will download a file i don't know why with many 19390-19411/jtun2socks.shadowrouter.org.jtun2socks W/System: A resource failed to call close. in the logcat

DrBrad commented 2 years ago

Likely I missed some output or socket close, thats due to a "file" closing. The app works perfectly, and as intended. It is just a global socks proxy client, if it is downloading content it may be the site, your browser or the proxy. Files will download due to content type, which is not changed at all within the tunnel.

try going to https://www.google.com when you browse using Chrome and double check your Socks proxy. This app doesn't support UDP, however thats not used in HTTP/HTTPS.

PayaMousavi commented 2 years ago

as u can see i get ssl error on google.com with VPN: https://user-images.githubusercontent.com/59400836/149618688-2c6429cb-9c25-42c3-a5ce-473f3496e960.mp4 i test proxy server with other clients like socksdroid and it works fine

DrBrad commented 2 years ago

As i stated earlier the proxy.java specifies the ip address and port.

The gui does not do anything at all, i forgot to implement it.

Just look for the ip address and port within the class change it and youll be good to go.

PayaMousavi commented 2 years ago

Yes i changed proxy server ip in proxy.java file, if it was wrong address it show no internet error but this is different

DrBrad commented 2 years ago

I don't think the issue is with the code, I have tested this just now with 5 phones with 5 different SOCKS5 servers and I'm having no issues.

The issue displayed in the video is due to ether an invalid SOCKS server or configuration to the server.

PayaMousavi commented 2 years ago

I tried with diffrent proxy servers and still it doesn't connect could you pls name your proxy server you are using?

DrBrad commented 2 years ago

Try running this: https://github.com/DrBrad/OpenProxy The IP address is your machines IP and the port is 8080. I did notice that the client did act odd the first time running it.