add bind for relay

This commit is contained in:
ginuerzh
2021-11-25 17:29:54 +08:00
parent 98ef6c7492
commit 6daf0a4d0f
29 changed files with 600 additions and 352 deletions

View File

@ -51,8 +51,7 @@ func (c *shadowConn) Write(b []byte) (n int, err error) {
n = len(b) // force byte length consistent
if c.wbuf.Len() > 0 {
c.wbuf.Write(b) // append the data to the cached header
_, err = c.Conn.Write(c.wbuf.Bytes())
c.wbuf.Reset()
_, err = c.wbuf.WriteTo(c.Conn)
return
}
_, err = c.Conn.Write(b)