refactor: WARP

This commit is contained in:
Shtorm
2025-06-08 19:51:17 +03:00
parent dfc6fce8bb
commit 3d8c74efa4
12 changed files with 346 additions and 253 deletions

View File

@@ -10,12 +10,13 @@ type ExperimentalOptions struct {
}
type CacheFileOptions struct {
Enabled bool `json:"enabled,omitempty"`
Path string `json:"path,omitempty"`
CacheID string `json:"cache_id,omitempty"`
StoreFakeIP bool `json:"store_fakeip,omitempty"`
StoreRDRC bool `json:"store_rdrc,omitempty"`
RDRCTimeout badoption.Duration `json:"rdrc_timeout,omitempty"`
Enabled bool `json:"enabled,omitempty"`
Path string `json:"path,omitempty"`
CacheID string `json:"cache_id,omitempty"`
StoreFakeIP bool `json:"store_fakeip,omitempty"`
StoreRDRC bool `json:"store_rdrc,omitempty"`
StoreWARPConfig bool `json:"store_warp_config,omitempty"`
RDRCTimeout badoption.Duration `json:"rdrc_timeout,omitempty"`
}
type ClashAPIOptions struct {

View File

@@ -30,20 +30,23 @@ type WireGuardPeer struct {
Reserved []uint8 `json:"reserved,omitempty"`
}
type WireGuardWarpEndpointOptions struct {
System bool `json:"system,omitempty"`
Name string `json:"name,omitempty"`
ListenPort uint16 `json:"listen_port,omitempty"`
UDPTimeout badoption.Duration `json:"udp_timeout,omitempty"`
Workers int `json:"workers,omitempty"`
Amnezia *WireGuardAmnezia `json:"amnezia,omitempty"`
Profile *WireGuardWarpProfile `json:"profile,omitempty"`
type WireGuardWARPEndpointOptions struct {
System bool `json:"system,omitempty"`
Name string `json:"name,omitempty"`
ListenPort uint16 `json:"listen_port,omitempty"`
UDPTimeout badoption.Duration `json:"udp_timeout,omitempty"`
Workers int `json:"workers,omitempty"`
Amnezia *WireGuardAmnezia `json:"amnezia,omitempty"`
Profile *WireGuardCloudflareProfile `json:"profile,omitempty"`
DialerOptions
}
type WireGuardWarpProfile struct {
Detour string `json:"detour,omitempty"`
Recreate bool `json:"recreate,omitempty"`
type WireGuardCloudflareProfile struct {
ID string `json:"id,omitempty"`
PrivateKey string `json:"private_key,omitempty"`
AuthToken string `json:"auth_token,omitempty"`
Recreate bool `json:"recreate,omitempty"`
Detour string `json:"detour,omitempty"`
}
type LegacyWireGuardOutboundOptions struct {