Skip to content

Backend channel handler#110

Open
kaoh wants to merge 2 commits intochhsiao90:masterfrom
koh-osug:backend_channel_handler
Open

Backend channel handler#110
kaoh wants to merge 2 commits intochhsiao90:masterfrom
koh-osug:backend_channel_handler

Conversation

@kaoh
Copy link
Copy Markdown

@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
Copy Markdown
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
Copy Markdown
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