mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-04-04 04:17:36 +03:00
Add v2ray QUIC transport
This commit is contained in:
parent
77c98fd042
commit
d4b7e221f0
22 changed files with 336 additions and 25 deletions
|
@ -10,6 +10,7 @@ type _V2RayTransportOptions struct {
|
|||
Type string `json:"type,omitempty"`
|
||||
GRPCOptions V2RayGRPCOptions `json:"-"`
|
||||
WebsocketOptions V2RayWebsocketOptions `json:"-"`
|
||||
QUICOptions V2RayQUICOptions `json:"-"`
|
||||
}
|
||||
|
||||
type V2RayTransportOptions _V2RayTransportOptions
|
||||
|
@ -23,6 +24,8 @@ func (o V2RayTransportOptions) MarshalJSON() ([]byte, error) {
|
|||
v = o.GRPCOptions
|
||||
case C.V2RayTransportTypeWebsocket:
|
||||
v = o.WebsocketOptions
|
||||
case C.V2RayTransportTypeQUIC:
|
||||
v = o.QUICOptions
|
||||
default:
|
||||
return nil, E.New("unknown transport type: " + o.Type)
|
||||
}
|
||||
|
@ -38,6 +41,10 @@ func (o *V2RayTransportOptions) UnmarshalJSON(bytes []byte) error {
|
|||
switch o.Type {
|
||||
case C.V2RayTransportTypeGRPC:
|
||||
v = &o.GRPCOptions
|
||||
case C.V2RayTransportTypeWebsocket:
|
||||
v = &o.WebsocketOptions
|
||||
case C.V2RayTransportTypeQUIC:
|
||||
v = &o.QUICOptions
|
||||
default:
|
||||
return E.New("unknown transport type: " + o.Type)
|
||||
}
|
||||
|
@ -102,3 +109,5 @@ type V2RayWebsocketOptions struct {
|
|||
MaxEarlyData uint32 `json:"max_early_data,omitempty"`
|
||||
EarlyDataHeaderName string `json:"early_data_header_name,omitempty"`
|
||||
}
|
||||
|
||||
type V2RayQUICOptions struct{}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue