github.com/v2fly/v2ray-core/v5@v5.16.2-0.20240507031116-8191faa6e095/infra/conf/v5cfg/skeleton.go (about)

     1  package v5cfg
     2  
     3  import (
     4  	"encoding/json"
     5  
     6  	"github.com/v2fly/v2ray-core/v5/infra/conf/cfgcommon"
     7  	"github.com/v2fly/v2ray-core/v5/infra/conf/cfgcommon/muxcfg"
     8  	"github.com/v2fly/v2ray-core/v5/infra/conf/cfgcommon/proxycfg"
     9  	"github.com/v2fly/v2ray-core/v5/infra/conf/cfgcommon/sniffer"
    10  	"github.com/v2fly/v2ray-core/v5/infra/conf/cfgcommon/socketcfg"
    11  )
    12  
    13  type RootConfig struct {
    14  	LogConfig    json.RawMessage            `json:"log"`
    15  	DNSConfig    json.RawMessage            `json:"dns"`
    16  	RouterConfig json.RawMessage            `json:"router"`
    17  	Inbounds     []InboundConfig            `json:"inbounds"`
    18  	Outbounds    []OutboundConfig           `json:"outbounds"`
    19  	Services     map[string]json.RawMessage `json:"services"`
    20  	Extensions   []json.RawMessage          `json:"extension"`
    21  }
    22  
    23  type InboundConfig struct {
    24  	Protocol       string                  `json:"protocol"`
    25  	PortRange      *cfgcommon.PortRange    `json:"port"`
    26  	ListenOn       *cfgcommon.Address      `json:"listen"`
    27  	Settings       json.RawMessage         `json:"settings"`
    28  	Tag            string                  `json:"tag"`
    29  	SniffingConfig *sniffer.SniffingConfig `json:"sniffing"`
    30  	StreamSetting  *StreamConfig           `json:"streamSettings"`
    31  }
    32  
    33  type OutboundConfig struct {
    34  	Protocol       string                `json:"protocol"`
    35  	SendThrough    *cfgcommon.Address    `json:"sendThrough"`
    36  	Tag            string                `json:"tag"`
    37  	Settings       json.RawMessage       `json:"settings"`
    38  	StreamSetting  *StreamConfig         `json:"streamSettings"`
    39  	ProxySettings  *proxycfg.ProxyConfig `json:"proxySettings"`
    40  	MuxSettings    *muxcfg.MuxConfig     `json:"mux"`
    41  	DomainStrategy string                `json:"domainStrategy"`
    42  }
    43  
    44  type StreamConfig struct {
    45  	Transport         string                 `json:"transport"`
    46  	TransportSettings json.RawMessage        `json:"transportSettings"`
    47  	Security          string                 `json:"security"`
    48  	SecuritySettings  json.RawMessage        `json:"securitySettings"`
    49  	SocketSettings    socketcfg.SocketConfig `json:"socketSettings"`
    50  }