-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSingBoxConfig.pas
More file actions
58 lines (44 loc) · 1002 Bytes
/
Copy pathSingBoxConfig.pas
File metadata and controls
58 lines (44 loc) · 1002 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
unit SingBoxConfig;
interface
uses
SingBoxBpf;
type
TConfigSourceFormat = (csfJson, csfBpf);
TConfigSelector = record
name: string;
outbounds: TArray<string>;
defaultIndex: integer;
defaultName: string;
end;
TConfigSelectors = TArray<TConfigSelector>;
TClashApiConfig = record
externalController: string;
secret: string;
function IsConfigured: boolean;
end;
TConfigSource = record
filePath: string;
format: TConfigSourceFormat;
jsonText: string;
bpfProfile: TBpfProfile;
function isBpf: boolean;
end;
TSingBoxConfig = record
clashApi: TClashApiConfig;
selectors: TConfigSelectors;
proxyHost: string;
proxyPort: integer;
hasTunInbound: boolean;
jsonWithTun: string;
jsonWithoutTun: string;
end;
implementation
function TConfigSource.isBpf: boolean;
begin
result := format = csfBpf;
end;
function TClashApiConfig.IsConfigured: boolean;
begin
result := externalController <> '';
end;
end.