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

Backend channel handler #110

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kaoh
Copy link

@kaoh kaoh commented Oct 19, 2021

This relates to #82. Under Android a channel must be "protected", i.e. marked as being already handled by a VPNService, otherwise a loop would result also redirecting the network traffic to the VPNService again. I created this hook to be able to get access for this and possibly other requirements in a generic way. Under Android setOnConnectHandler would be called and from the Netty Channel the channel id could be cast to a socket integer.

Questions:
a) Is the logic really called first after the channel is created, so that any VpnService cannot handle the channel again?
b) Is this the best approach?

@chhsiao90
Copy link
Owner

chhsiao90 commented Oct 20, 2021

Hi @koh-osug

I'm going to redesign the listener (d805794 of #111), what do you think if adding the callback to the listener interface instead? I'm also thinking to add more callback to the listener function, like failure handling.

For your question a, yes, it would only be called once while the channel was initiated.
And for the second question, can you check the #111 and see if adding onConnect to the listener works for you?

@kaoh
Copy link
Author

kaoh commented Oct 20, 2021

onConnect should do it, as long as it is configurable from the NitmProxyMaster and provides access to the Channel.

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

Successfully merging this pull request may close these issues.

2 participants