[client] Add block inbound option to the embed client (#5215)

This commit is contained in:
Viktor Liu
2026-01-30 17:42:39 +08:00
committed by GitHub
parent 101c813e98
commit 0c990ab662
3 changed files with 16 additions and 0 deletions

View File

@@ -69,6 +69,8 @@ type Options struct {
StatePath string
// DisableClientRoutes disables the client routes
DisableClientRoutes bool
// BlockInbound blocks all inbound connections from peers
BlockInbound bool
}
// validateCredentials checks that exactly one credential type is provided
@@ -137,6 +139,7 @@ func New(opts Options) (*Client, error) {
PreSharedKey: &opts.PreSharedKey,
DisableServerRoutes: &t,
DisableClientRoutes: &opts.DisableClientRoutes,
BlockInbound: &opts.BlockInbound,
}
if opts.ConfigPath != "" {
config, err = profilemanager.UpdateOrCreateConfig(input)