lima icon indicating copy to clipboard operation
lima copied to clipboard

portfwdserver: consolidate `bicopy` and `tcpproxy` packages into one

Open AkihiroSuda opened this issue 5 months ago • 3 comments

https://github.com/lima-vm/lima/blob/83cbc0262baeb8b1ce0407094a53f3ad90aa7a84/pkg/portfwdserver/server.go#L44-L58

AkihiroSuda avatar Jul 10 '25 05:07 AkihiroSuda

Did we try with upstream tcpproxy? the givisor version is not the same.

Upstream version does:

  1. Start io.Copy(src, dst)
  2. Start io.Copy(dst, src)
  3. When io.Copy() finish, do CloseWrite(dst) and CloseRead(src)
  4. Wait until both io.Copy finish
  5. Close src and dst

givisor version does:

  1. Start io.Copy(src, dst)
  2. Start io.Copy(dst, src)
  3. Wait until first io.Copy finish
  4. Close src and dst

nirs avatar Jul 10 '25 20:07 nirs

I'm changing tcpproxy to https://github.com/inetaf/tcpproxy in #4175

norio-nomura avatar Oct 12 '25 05:10 norio-nomura

It changed to use "github.com/containers/gvisor-tap-vsock/pkg/tcpproxy" by #4237. I benchmarked by using:

  • github.com/containers/gvisor-tap-vsock/pkg/tcpproxy
  • github.com/inetaf/tcpproxy
  • github.com/lima-vm/lima/v2/pkg/bicopy

However, there was no big difference, so I used gvisor-tap-vsock's tcpproxy as it is.

norio-nomura avatar Oct 22 '25 01:10 norio-nomura