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

Function extractPort

cmd/wireproxy/main.go:121–133  ·  view source on GitHub ↗
(addr string)

Source from the content-addressed store, hash-verified

119}
120
121func extractPort(addr string) uint16 {
122 _, portStr, err := net.SplitHostPort(addr)
123 if err != nil {
124 panic(fmt.Errorf("failed to extract port from %s: %w", addr, err))
125 }
126
127 port, err := strconv.Atoi(portStr)
128 if err != nil {
129 panic(fmt.Errorf("failed to extract port from %s: %w", addr, err))
130 }
131
132 return uint16(port)
133}
134
135func lockNetwork(sections []wireproxy.RoutineSpawner, infoAddr *string) {
136 var rules []landlock.Rule

Callers 1

lockNetworkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected