lima
lima copied to clipboard
portfwdserver: consolidate `bicopy` and `tcpproxy` packages into one
https://github.com/lima-vm/lima/blob/83cbc0262baeb8b1ce0407094a53f3ad90aa7a84/pkg/portfwdserver/server.go#L44-L58
Did we try with upstream tcpproxy? the givisor version is not the same.
Upstream version does:
- Start io.Copy(src, dst)
- Start io.Copy(dst, src)
- When io.Copy() finish, do CloseWrite(dst) and CloseRead(src)
- Wait until both io.Copy finish
- Close src and dst
givisor version does:
- Start io.Copy(src, dst)
- Start io.Copy(dst, src)
- Wait until first io.Copy finish
- Close src and dst
I'm changing tcpproxy to https://github.com/inetaf/tcpproxy in #4175
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.