Skip to content

Add CustomDialer option for LeafNodes #6907

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

chezgi
Copy link

@chezgi chezgi commented May 19, 2025

custom dialer is needed when we want to do custom operations like fwmark of connection packets.

Signed-off-by: abbas ali chezgi [email protected]

custom dialer is needed when we want to do custom operations like fwmark of connection packets.
@chezgi chezgi requested a review from a team as a code owner May 19, 2025 23:50
@wallyqs wallyqs changed the title Main Add CustomDialer option for LeafNodes May 19, 2025
Copy link
Member

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the very least this needs tests, but also wondering more about this use-case. This must be an embedded server?

@chezgi
Copy link
Author

chezgi commented May 20, 2025

Its use case is for embedded mode.
some situations that this is used:

  • when used for control connection of network elements like routers, it must be able to bind to specific device for using VRF in linux
  • when used for control connection of vpn elements, it must be able to use fwmark for its outgoing packets, to not pass inside tunnel.

@chezgi chezgi requested a review from neilalexander May 21, 2025 02:06
@lschmierer
Copy link

I like the effort, we have a similar use case.
A few notes though:

  • It does not handle the timeout. It might be worthwhile to rewrite the natsDialTimeout function to call DialContext with a context.WithTimeout and let a custom DialContext function be passed to that.
  • If you want to capture all traffic (including DNS) I think you would to also provide your own resolver LookupHost function. Using DNS host names within a user-space VPN would require this too

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.

3 participants