Fix socks5 packet conn

This commit is contained in:
dyhkwong 2024-05-17 20:28:11 +08:00 committed by 世界
parent 8fb1634c9a
commit 284cb5ce98
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
5 changed files with 59 additions and 71 deletions

View file

@ -17,23 +17,13 @@ type VectorisedAssociatePacketConn struct {
N.VectorisedPacketWriter
}
func NewVectorisedAssociatePacketConn(conn net.PacketConn, writer N.VectorisedPacketWriter, remoteAddr M.Socksaddr, underlying net.Conn) *VectorisedAssociatePacketConn {
return &VectorisedAssociatePacketConn{
AssociatePacketConn{
NetPacketConn: bufio.NewPacketConn(conn),
remoteAddr: remoteAddr,
underlying: underlying,
},
writer,
}
}
func NewVectorisedAssociateConn(conn net.Conn, writer N.VectorisedWriter, remoteAddr M.Socksaddr, underlying net.Conn) *VectorisedAssociatePacketConn {
return &VectorisedAssociatePacketConn{
AssociatePacketConn{
NetPacketConn: bufio.NewUnbindPacketConn(conn),
remoteAddr: remoteAddr,
underlying: underlying,
AbstractConn: conn,
conn: bufio.NewExtendedConn(conn),
remoteAddr: remoteAddr,
underlying: underlying,
},
&bufio.UnbindVectorisedPacketWriter{VectorisedWriter: writer},
}