@@ -17,15 +17,15 @@ import (
1717)
1818
1919type PortforwardOption struct {
20- ID string `help:"task ID"`
21- Container string `help:"container name"`
22- LocalPort int `help:"local port"`
23- RemotePort int `help:"remote port"`
24- RemoteHost string `help:"remote host"`
25- L string `name:"L" help:"short expression of local-port:remote-host:remote-port" short:"L"`
26- Family * string `help:"task definition family name"`
27- Service * string `help:"ECS service name"`
28- Public bool `help:"bind to all interfaces (0.0.0.0) instead of localhost only"`
20+ ID string `help:"task ID"`
21+ Container string `help:"container name"`
22+ LocalPort int `help:"local port"`
23+ RemotePort int `help:"remote port"`
24+ RemoteHost string `help:"remote host"`
25+ L string `name:"L" help:"short expression of local-port:remote-host:remote-port" short:"L"`
26+ Family * string `help:"task definition family name"`
27+ Service * string `help:"ECS service name"`
28+ Public bool `help:"bind to all interfaces (0.0.0.0) instead of localhost only"`
2929
3030 stdout io.Writer
3131 stderr io.Writer
@@ -129,14 +129,14 @@ func (app *Ecsta) RunPortforward(ctx context.Context, opt *PortforwardOption) er
129129 if opt .Public {
130130 slog .Warn ("TCP proxy will bind to all interfaces (0.0.0.0) - ensure proper network security" , "port" , opt .LocalPort )
131131 slog .Info ("Session Manager Plugin will use port" , "port" , ssmLocalPort )
132-
132+
133133 // Start TCP proxy in background
134134 go func () {
135135 if err := app .startTCPProxyToLocalhost (ctx , "0.0.0.0" , opt .LocalPort , ssmLocalPort ); err != nil {
136136 slog .Error ("TCP proxy failed" , "error" , err )
137137 }
138138 }()
139-
139+
140140 // Wait a bit for proxy to start
141141 time .Sleep (200 * time .Millisecond )
142142 }
@@ -194,7 +194,7 @@ func (app *Ecsta) handleProxyConnection(ctx context.Context, clientConn net.Conn
194194 // Start bidirectional copy with context cancellation
195195 var wg sync.WaitGroup
196196 done := make (chan struct {})
197-
197+
198198 wg .Add (2 )
199199
200200 // Copy from client to backend
@@ -232,4 +232,3 @@ func (app *Ecsta) handleProxyConnection(ctx context.Context, clientConn net.Conn
232232 wg .Wait ()
233233 }
234234}
235-
0 commit comments