MCPcopy
hub / github.com/windtf/wireproxy / parseUDPProxyTunnelConfig

Function parseUDPProxyTunnelConfig

config.go:470–496  ·  view source on GitHub ↗
(section *ini.Section)

Source from the content-addressed store, hash-verified

468}
469
470func parseUDPProxyTunnelConfig(section *ini.Section) (RoutineSpawner, error) {
471 config := &UDPProxyTunnelConfig{}
472
473 bindAddress, err := parseString(section, "BindAddress")
474 if err != nil {
475 return nil, err
476 }
477 config.BindAddress = bindAddress
478
479 target, err := parseString(section, "Target")
480 if err != nil {
481 return nil, err
482 }
483 config.Target = target
484
485 inactivityTimeout := 0
486 if sectionKey, err := section.GetKey("InactivityTimeout"); err == nil {
487 timeoutVal, err := sectionKey.Int()
488 if err != nil {
489 return nil, err
490 }
491 inactivityTimeout = timeoutVal
492 }
493 config.InactivityTimeout = inactivityTimeout
494
495 return config, nil
496}
497
498// Takes a function that parses an individual section into a config, and apply it on all
499// specified sections

Callers

nothing calls this directly

Calls 1

parseStringFunction · 0.85

Tested by

no test coverage detected