Skip to content

Commit d877648

Browse files
authored
Merge pull request #3684 from balajiv113/fix-keepalive
Fix tunneling of connection when keepalive is set
2 parents 8b30287 + f885c17 commit d877648

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pkg/portfwd/client.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import (
1010
"time"
1111

1212
"github.com/containers/gvisor-tap-vsock/pkg/services/forwarder"
13+
"github.com/containers/gvisor-tap-vsock/pkg/tcpproxy"
1314
"github.com/sirupsen/logrus"
1415

15-
"github.com/lima-vm/lima/pkg/bicopy"
1616
"github.com/lima-vm/lima/pkg/guestagent/api"
1717
guestagentclient "github.com/lima-vm/lima/pkg/guestagent/api/client"
1818
)
@@ -33,7 +33,10 @@ func HandleTCPConnection(ctx context.Context, client *guestagentclient.GuestAgen
3333
}
3434

3535
rw := &GrpcClientRW{stream: stream, id: id, addr: guestAddr, protocol: "tcp"}
36-
bicopy.Bicopy(rw, conn, nil)
36+
proxy := tcpproxy.DialProxy{DialContext: func(_ context.Context, _, _ string) (net.Conn, error) {
37+
return conn, nil
38+
}}
39+
proxy.HandleConn(rw)
3740
}
3841

3942
func HandleUDPConnection(ctx context.Context, client *guestagentclient.GuestAgentClient, conn net.PacketConn, guestAddr string) {

0 commit comments

Comments
 (0)