chore: restful api display fast-open for tuic and hysteria

This commit is contained in:
metacubex
2022-11-28 19:52:55 +08:00
committed by wwqgtxx
parent 9ea09b2b94
commit 8c0fbb3665
5 changed files with 13 additions and 3 deletions

View File

@ -18,6 +18,7 @@ type Base struct {
iface string
tp C.AdapterType
udp bool
tfo bool
rmark int
id string
prefer C.DNSPrefer
@ -76,6 +77,11 @@ func (b *Base) SupportUDP() bool {
return b.udp
}
// SupportTFO implements C.ProxyAdapter
func (b *Base) SupportTFO() bool {
return b.tfo
}
// MarshalJSON implements C.ProxyAdapter
func (b *Base) MarshalJSON() ([]byte, error) {
return json.Marshal(map[string]string{
@ -130,6 +136,7 @@ type BaseOption struct {
Addr string
Type C.AdapterType
UDP bool
TFO bool
Interface string
RoutingMark int
Prefer C.DNSPrefer
@ -141,6 +148,7 @@ func NewBase(opt BaseOption) *Base {
addr: opt.Addr,
tp: opt.Type,
udp: opt.UDP,
tfo: opt.TFO,
iface: opt.Interface,
rmark: opt.RoutingMark,
prefer: opt.Prefer,