2021-09-04 11:11:46 -04:00
|
|
|
package v5cfg
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
2021-10-28 06:34:19 -04:00
|
|
|
|
2022-01-02 10:16:23 -05:00
|
|
|
"github.com/v2fly/v2ray-core/v5/infra/conf/cfgcommon"
|
|
|
|
"github.com/v2fly/v2ray-core/v5/infra/conf/cfgcommon/muxcfg"
|
|
|
|
"github.com/v2fly/v2ray-core/v5/infra/conf/cfgcommon/proxycfg"
|
|
|
|
"github.com/v2fly/v2ray-core/v5/infra/conf/cfgcommon/sniffer"
|
|
|
|
"github.com/v2fly/v2ray-core/v5/infra/conf/cfgcommon/socketcfg"
|
2021-09-04 11:11:46 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
type RootConfig struct {
|
2021-09-06 13:18:22 -04:00
|
|
|
LogConfig json.RawMessage `json:"log"`
|
|
|
|
DNSConfig json.RawMessage `json:"dns"`
|
|
|
|
RouterConfig json.RawMessage `json:"router"`
|
2021-09-04 13:45:02 -04:00
|
|
|
Inbounds []InboundConfig `json:"inbounds"`
|
|
|
|
Outbounds []OutboundConfig `json:"outbounds"`
|
|
|
|
Services map[string]json.RawMessage `json:"services"`
|
2021-09-06 13:18:22 -04:00
|
|
|
Extensions []json.RawMessage `json:"extension"`
|
2021-09-04 11:11:46 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
type InboundConfig struct {
|
|
|
|
Protocol string `json:"protocol"`
|
|
|
|
PortRange *cfgcommon.PortRange `json:"port"`
|
|
|
|
ListenOn *cfgcommon.Address `json:"listen"`
|
2021-09-04 12:49:37 -04:00
|
|
|
Settings json.RawMessage `json:"settings"`
|
2021-09-04 11:11:46 -04:00
|
|
|
Tag string `json:"tag"`
|
|
|
|
SniffingConfig *sniffer.SniffingConfig `json:"sniffing"`
|
|
|
|
StreamSetting *StreamConfig `json:"streamSettings"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type OutboundConfig struct {
|
|
|
|
Protocol string `json:"protocol"`
|
|
|
|
SendThrough *cfgcommon.Address `json:"sendThrough"`
|
|
|
|
Tag string `json:"tag"`
|
2021-09-04 12:57:12 -04:00
|
|
|
Settings json.RawMessage `json:"settings"`
|
2021-09-04 11:11:46 -04:00
|
|
|
StreamSetting *StreamConfig `json:"streamSettings"`
|
|
|
|
ProxySettings *proxycfg.ProxyConfig `json:"proxySettings"`
|
|
|
|
MuxSettings *muxcfg.MuxConfig `json:"mux"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type StreamConfig struct {
|
|
|
|
Transport string `json:"transport"`
|
|
|
|
TransportSettings json.RawMessage `json:"transportSettings"`
|
|
|
|
Security string `json:"security"`
|
|
|
|
SecuritySettings json.RawMessage `json:"securitySettings"`
|
|
|
|
SocketSettings socketcfg.SocketConfig `json:"socketSettings"`
|
|
|
|
}
|