Extract processChunk and readLoopError helpers to eliminate ~30
lines of duplicated read-validate-notify logic across readLoop,
readLoopPacket, and readLoopSerial.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Extend Mode constants (3=TCPServer, 4=UDPServer, 5=COMPort) with
explicit values. Refactor Target to support multiple connection types
(listener+conns map, packetConn, serialPort). Add acceptLoop,
readLoopPacket, readLoopSerial. Mode-aware Broadcast dispatches to
all accepted conns (TCP-S), known remotes (UDP-S), or serial port.
Update flag help, command completions, and TUI panel hints.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Move ForwardManager → pkg/forward/Manager and PluginManager →
pkg/luaplugin/Manager. Move FoeWardMode (now forward.Mode) with
ParseMode/Network/String into pkg/forward. Rename constants:
NOT→None, TCPC→TCP, UDPC→UDP. Update all references in main
package.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>