mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-05-14 00:51:12 +03:00
Refactor inbound/outbound options struct
This commit is contained in:
@@ -17,6 +17,23 @@ type InboundTLSOptions struct {
|
||||
Reality *InboundRealityOptions `json:"reality,omitempty"`
|
||||
}
|
||||
|
||||
type InboundTLSOptionsContainer struct {
|
||||
TLS *InboundTLSOptions `json:"tls,omitempty"`
|
||||
}
|
||||
|
||||
type InboundTLSOptionsWrapper interface {
|
||||
TakeInboundTLSOptions() *InboundTLSOptions
|
||||
ReplaceInboundTLSOptions(options *InboundTLSOptions)
|
||||
}
|
||||
|
||||
func (o *InboundTLSOptionsContainer) TakeInboundTLSOptions() *InboundTLSOptions {
|
||||
return o.TLS
|
||||
}
|
||||
|
||||
func (o *InboundTLSOptionsContainer) ReplaceInboundTLSOptions(options *InboundTLSOptions) {
|
||||
o.TLS = options
|
||||
}
|
||||
|
||||
type OutboundTLSOptions struct {
|
||||
Enabled bool `json:"enabled,omitempty"`
|
||||
DisableSNI bool `json:"disable_sni,omitempty"`
|
||||
@@ -33,6 +50,23 @@ type OutboundTLSOptions struct {
|
||||
Reality *OutboundRealityOptions `json:"reality,omitempty"`
|
||||
}
|
||||
|
||||
type OutboundTLSOptionsContainer struct {
|
||||
TLS *OutboundTLSOptions `json:"tls,omitempty"`
|
||||
}
|
||||
|
||||
type OutboundTLSOptionsWrapper interface {
|
||||
TakeOutboundTLSOptions() *OutboundTLSOptions
|
||||
ReplaceOutboundTLSOptions(options *OutboundTLSOptions)
|
||||
}
|
||||
|
||||
func (o *OutboundTLSOptionsContainer) TakeOutboundTLSOptions() *OutboundTLSOptions {
|
||||
return o.TLS
|
||||
}
|
||||
|
||||
func (o *OutboundTLSOptionsContainer) ReplaceOutboundTLSOptions(options *OutboundTLSOptions) {
|
||||
o.TLS = options
|
||||
}
|
||||
|
||||
type InboundRealityOptions struct {
|
||||
Enabled bool `json:"enabled,omitempty"`
|
||||
Handshake InboundRealityHandshakeOptions `json:"handshake,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user