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

Protect channel when used in Android VpnService #82

Open
kaoh opened this issue Jul 22, 2021 · 0 comments
Open

Protect channel when used in Android VpnService #82

kaoh opened this issue Jul 22, 2021 · 0 comments

Comments

@kaoh
Copy link

kaoh commented Jul 22, 2021

Under android when using a VpnService it is necessary to mark a socket as handled by the VpnService otherwise a loop results and the network traffic is routed to the VpnService again. See https://stackoverflow.com/questions/43463044/protecting-socket-when-using-netty4-on-android-with-Service.

A new method protect could be added to com.github.chhsiao90.nitmproxy.channel.BackendChannelBootstrap, which would be called on success on the io.netty.channel.ChannelFuture and get the Channel. By default this would be a no op, but a handler logic could be passed with the config. The VpnService.protect method needs a socket or socket ID, I was wondering if the ChannelId of Netty provides this or what could be done to achieve the goal. How to get the underlying socket or the socket ID?

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

1 participant