1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-28 04:55:37 -05:00

cleanup buf interfaces

This commit is contained in:
Darien Raymond
2018-07-31 13:43:27 +02:00
parent b3cf1f70d7
commit 7baa6977d3
9 changed files with 28 additions and 32 deletions

View File

@@ -110,14 +110,14 @@ func (d *DokodemoDoor) Process(ctx context.Context, network net.Network, conn in
} else {
//if we are in TPROXY mode, use linux's udp forging functionality
if !d.config.FollowRedirect {
writer = buf.NewSequentialWriter(conn)
writer = &buf.SequentialWriter{Writer: conn}
} else {
srca := net.UDPAddr{IP: dest.Address.IP(), Port: int(dest.Port.Value())}
origsend, err := udp.TransmitSocket(&srca, conn.RemoteAddr())
if err != nil {
return err
}
writer = buf.NewSequentialWriter(origsend)
writer = &buf.SequentialWriter{Writer: origsend}
}
}