Hunter0x7c7
2022-08-11 a82f9cb69f63aaeba40c024960deda7d75b9fece
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package v5cfg
 
import (
    "encoding/json"
 
    "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"
)
 
type RootConfig struct {
    LogConfig    json.RawMessage            `json:"log"`
    DNSConfig    json.RawMessage            `json:"dns"`
    RouterConfig json.RawMessage            `json:"router"`
    Inbounds     []InboundConfig            `json:"inbounds"`
    Outbounds    []OutboundConfig           `json:"outbounds"`
    Services     map[string]json.RawMessage `json:"services"`
    Extensions   []json.RawMessage          `json:"extension"`
}
 
type InboundConfig struct {
    Protocol       string                  `json:"protocol"`
    PortRange      *cfgcommon.PortRange    `json:"port"`
    ListenOn       *cfgcommon.Address      `json:"listen"`
    Settings       json.RawMessage         `json:"settings"`
    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"`
    Settings      json.RawMessage       `json:"settings"`
    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"`
}