Minor fixes

This commit is contained in:
世界
2022-07-10 14:22:28 +08:00
parent 29f78248dc
commit 7f84191748
12 changed files with 69 additions and 39 deletions

View File

@@ -72,11 +72,11 @@ func (h *Shadowsocks) ListenPacket(ctx context.Context, destination M.Socksaddr)
metadata.Outbound = h.tag
metadata.Destination = destination
h.logger.WithContext(ctx).Info("outbound packet connection to ", h.serverAddr)
outConn, err := h.dialer.ListenPacket(ctx, destination)
outConn, err := h.dialer.DialContext(ctx, "udp", h.serverAddr)
if err != nil {
return nil, err
}
return h.method.DialPacketConn(&bufio.BindPacketConn{PacketConn: outConn, Addr: h.serverAddr.UDPAddr()}), nil
return h.method.DialPacketConn(outConn), nil
}
func (h *Shadowsocks) NewConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error {