LipiLee / ToyShark

Packet Analyzer for Android
Apache License 2.0
75 stars 35 forks source link

Not connecting to the internet when Vpn is enabled #2

Open dmitrybbch opened 6 years ago

dmitrybbch commented 6 years ago

Hi, I'm trying to build a really simple local VpnService that just sends the packages without actually doing anything to them, and looking for similiar projects (because I don't know much about networking) I found yours. Download and build works fine, however when launching on Android it seems like internet connection doesn't work anymore. Is this expected?

Thanks, Dmitry

LipiLee commented 6 years ago

Hi, @dmitrybbch No, it isn't expected. Internet connection should work fine after running this app. If you need a very simple VpnService sample code, check the Google's original Android VPN sample. https://github.com/aosp-mirror/platform_development/tree/master/samples/ToyVpn .

dmitrybbch commented 6 years ago

Thanks! But it seems to me that the sample from Google is not a local VPN, it has to connect to an external server. So I guess yours is the most similar to what I had in mind. On the connecting issue, if it helps, this is the Log: 03-17 13:49:44.348 28176-28311/com.lipisoft.toyshark E/SessionHandler: ==> Session not found: 10.120.0.1:33519-66.102.1.188:5228 03-17 13:49:45.460 28176-28311/com.lipisoft.toyshark E/SessionHandler: ==> Session not found: 10.120.0.1:56871-74.125.200.188:443 03-17 13:49:46.273 28176-28311/com.lipisoft.toyshark E/SessionHandler: ==> Session not found: 10.120.0.1:51401-169.47.5.248:5222 03-17 13:49:46.781 28176-28311/com.lipisoft.toyshark E/SessionHandler: ==> Session not found: 10.120.0.1:56566-169.60.79.89:80 03-17 13:49:54.685 28176-28311/com.lipisoft.toyshark E/SessionHandler: **** ==> Session not found: 10.120.0.1:40942-31.13.86.34:443 (and keeps going)

LipiLee commented 6 years ago

@dmitrybbch, thanks for your critical bug report. I found the current master version was not working well. I committed some patches for it.

CandySu commented 6 years ago

image

CandySu commented 6 years ago

I fetch the latest code,then Logcat output too much error info as before

LipiLee commented 6 years ago

@CandySu , thanks for your report. So I submitted a patch for it. And this project have used AT&T ARO project(https://github.com/attdevsupport/ARO) as TCP/IP stack. Unfortunately it has been not clean as you know. If you want to clean it, welcome to your PRs for it.

CandySu commented 6 years ago

@LipiLee Thank you for your kindly help and sharing.