Add vless outbound and xudp

This commit is contained in:
世界
2022-09-12 21:59:27 +08:00
parent 6efce450dd
commit 581fc4cd33
12 changed files with 783 additions and 49 deletions

View File

@@ -22,6 +22,7 @@ type _Outbound struct {
SSHOptions SSHOutboundOptions `json:"-"`
ShadowTLSOptions ShadowTLSOutboundOptions `json:"-"`
ShadowsocksROptions ShadowsocksROutboundOptions `json:"-"`
VLESSOptions VLESSOutboundOptions `json:"-"`
SelectorOptions SelectorOutboundOptions `json:"-"`
}
@@ -56,6 +57,8 @@ func (h Outbound) MarshalJSON() ([]byte, error) {
v = h.ShadowTLSOptions
case C.TypeShadowsocksR:
v = h.ShadowsocksROptions
case C.TypeVLESS:
v = h.VLESSOptions
case C.TypeSelector:
v = h.SelectorOptions
default:
@@ -97,6 +100,8 @@ func (h *Outbound) UnmarshalJSON(bytes []byte) error {
v = &h.ShadowTLSOptions
case C.TypeShadowsocksR:
v = &h.ShadowsocksROptions
case C.TypeVLESS:
v = &h.VLESSOptions
case C.TypeSelector:
v = &h.SelectorOptions
default:

11
option/vless.go Normal file
View File

@@ -0,0 +1,11 @@
package option
type VLESSOutboundOptions struct {
DialerOptions
ServerOptions
UUID string `json:"uuid"`
Network NetworkList `json:"network,omitempty"`
TLS *OutboundTLSOptions `json:"tls,omitempty"`
Transport *V2RayTransportOptions `json:"transport,omitempty"`
PacketEncoding string `json:"packet_encoding,omitempty"`
}