Fix missing address unwrap in redirect server

This commit is contained in:
世界 2024-06-09 10:03:12 +08:00
parent c4df3641c7
commit 21b78edd8b
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -74,7 +74,7 @@ func (s *redirectServer) loopIn() {
}
var metadata M.Metadata
metadata.Protocol = ProtocolRedirect
metadata.Source = M.SocksaddrFromNet(conn.RemoteAddr())
metadata.Source = M.SocksaddrFromNet(conn.RemoteAddr()).Unwrap()
destination, err := control.GetOriginalDestination(conn)
if err != nil {
_ = conn.SetLinger(0)
@ -82,7 +82,7 @@ func (s *redirectServer) loopIn() {
s.logger.Error("process connection from ", metadata.Source, ": invalid connection: ", err)
continue
}
metadata.Destination = M.SocksaddrFromNetIP(destination)
metadata.Destination = M.SocksaddrFromNetIP(destination).Unwrap()
go s.handler.NewConnection(s.ctx, conn, metadata)
}
}