XHTTP client: Move dest2 into MemoryStreamConfig as well

This commit is contained in:
RPRX
2024-11-04 05:00:18 +00:00
committed by GitHub
parent 2c72864935
commit 9fbb6fbb3b
2 changed files with 12 additions and 7 deletions

View File

@@ -1,7 +1,10 @@
package internet
import "github.com/xtls/xray-core/common/net"
// MemoryStreamConfig is a parsed form of StreamConfig. This is used to reduce the number of Protobuf parsings.
type MemoryStreamConfig struct {
Destination *net.Destination
ProtocolName string
ProtocolSettings interface{}
SecurityType string
@@ -23,6 +26,13 @@ func ToMemoryStreamConfig(s *StreamConfig) (*MemoryStreamConfig, error) {
}
if s != nil {
if s.Address != nil {
mss.Destination = &net.Destination{
Address: s.Address.AsAddress(),
Port: net.Port(s.Port),
Network: net.Network_TCP,
}
}
mss.SocketSettings = s.SocketSettings
}