separate network and transport protocol

This commit is contained in:
Darien Raymond committed 2017-01-12 12:54:34 +01:00
1 parent f9b3a1446a
commit d24fe9dbfb
41 files changed
+261 -321

No files matched your search

+6 -7
View File
@@ -2,7 +2,6 @@ package conf
import (
"v2ray.com/core/common/errors"
v2net "v2ray.com/core/common/net"
"v2ray.com/core/transport"
"v2ray.com/core/transport/internet"
)
@@ -21,8 +20,8 @@ func (v *TransportConfig) Build() (*transport.Config, error) {
if err != nil {
return nil, errors.Base(err).Message("Failed to build TCP config.")
}
config.NetworkSettings = append(config.NetworkSettings, &internet.NetworkSettings{
Network: v2net.Network_TCP,
config.TransportSettings = append(config.TransportSettings, &internet.TransportSettings{
Protocol: internet.TransportProtocol_TCP,
Settings: ts,
})
}
@@ -32,8 +31,8 @@ func (v *TransportConfig) Build() (*transport.Config, error) {
if err != nil {
return nil, errors.Base(err).Message("Failed to build mKCP config.")
}
config.NetworkSettings = append(config.NetworkSettings, &internet.NetworkSettings{
Network: v2net.Network_KCP,
config.TransportSettings = append(config.TransportSettings, &internet.TransportSettings{
Protocol: internet.TransportProtocol_MKCP,
Settings: ts,
})
}
@@ -43,8 +42,8 @@ func (v *TransportConfig) Build() (*transport.Config, error) {
if err != nil {
return nil, errors.Base(err).Message("Failed to build WebSocket config.")
}
config.NetworkSettings = append(config.NetworkSettings, &internet.NetworkSettings{
Network: v2net.Network_WebSocket,
config.TransportSettings = append(config.TransportSettings, &internet.TransportSettings{
Protocol: internet.TransportProtocol_WebSocket,
Settings: ts,
})
}