Add naive inbound and test
This commit is contained in:
@@ -19,6 +19,7 @@ type _Inbound struct {
|
||||
ShadowsocksOptions ShadowsocksInboundOptions `json:"-"`
|
||||
VMessOptions VMessInboundOptions `json:"-"`
|
||||
TrojanOptions TrojanInboundOptions `json:"-"`
|
||||
NaiveOptions NaiveInboundOptions `json:"-"`
|
||||
}
|
||||
|
||||
type Inbound _Inbound
|
||||
@@ -46,6 +47,8 @@ func (h Inbound) MarshalJSON() ([]byte, error) {
|
||||
v = h.VMessOptions
|
||||
case C.TypeTrojan:
|
||||
v = h.TrojanOptions
|
||||
case C.TypeNaive:
|
||||
v = h.NaiveOptions
|
||||
default:
|
||||
return nil, E.New("unknown inbound type: ", h.Type)
|
||||
}
|
||||
@@ -79,6 +82,8 @@ func (h *Inbound) UnmarshalJSON(bytes []byte) error {
|
||||
v = &h.VMessOptions
|
||||
case C.TypeTrojan:
|
||||
v = &h.TrojanOptions
|
||||
case C.TypeNaive:
|
||||
v = &h.NaiveOptions
|
||||
default:
|
||||
return E.New("unknown inbound type: ", h.Type)
|
||||
}
|
||||
|
||||
10
option/naive.go
Normal file
10
option/naive.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package option
|
||||
|
||||
import "github.com/sagernet/sing/common/auth"
|
||||
|
||||
type NaiveInboundOptions struct {
|
||||
ListenOptions
|
||||
Users []auth.User `json:"users,omitempty"`
|
||||
Network NetworkList `json:"network,omitempty"`
|
||||
TLS *InboundTLSOptions `json:"tls,omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user