1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-11 02:10:44 +00:00

add default settings

This commit is contained in:
Shelikhoo 2021-09-05 00:42:40 +01:00
parent 8c57d03418
commit 1e306a55e8
No known key found for this signature in database
GPG Key ID: C4D5E79D22B25316
2 changed files with 8 additions and 0 deletions

View File

@ -58,6 +58,10 @@ func (c InboundConfig) BuildV5(ctx context.Context) (proto.Message, error) {
receiverSettings.SniffingSettings = s
}
if c.Settings == nil {
c.Settings = []byte("{}")
}
inboundConfigPack, err := loadHeterogeneousConfigFromRawJson("inbound", c.Protocol, c.Settings)
if err != nil {
return nil, newError("unable to load inbound protocol config").Base(err)

View File

@ -40,6 +40,10 @@ func (c OutboundConfig) BuildV5(ctx context.Context) (proto.Message, error) {
senderSettings.MultiplexSettings = c.MuxSettings.Build()
}
if c.Settings == nil {
c.Settings = []byte("{}")
}
outboundConfigPack, err := loadHeterogeneousConfigFromRawJson("outbound", c.Protocol, c.Settings)
if err != nil {
return nil, newError("unable to load outbound protocol config").Base(err)