update github.com/pires/go-proxyproto to v0.5.0

This commit is contained in:
fatedier
2021-06-20 23:57:41 +08:00
parent 3f11b6a082
commit fe4e9b55f3
14 changed files with 127 additions and 43 deletions

View File

@@ -11,6 +11,7 @@ import (
"strconv"
"time"
"github.com/fatedier/frp/test/e2e/pkg/rpc"
libnet "github.com/fatedier/golib/net"
)
@@ -210,15 +211,14 @@ func sendHTTPRequest(method, urlstr string, host string, headers map[string]stri
}
func sendRequestByConn(c net.Conn, content []byte) ([]byte, error) {
_, err := c.Write(content)
_, err := rpc.WriteBytes(c, content)
if err != nil {
return nil, fmt.Errorf("write error: %v", err)
}
buf := make([]byte, 2048)
n, err := c.Read(buf)
buf, err := rpc.ReadBytes(c)
if err != nil {
return nil, fmt.Errorf("read error: %v", err)
}
return buf[:n], nil
return buf, nil
}