mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 17:38:41 +00:00
Add Fake DNS support (#309)
Co-authored-by: Xiaokang Wang <xiaokangwang@outlook.com> Co-authored-by: loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com> Co-authored-by: kslr <kslrwang@gmail.com>
This commit is contained in:
parent
db32ce6fd9
commit
f50eff5ebb
43 changed files with 1351 additions and 301 deletions
23
infra/conf/lint.go
Normal file
23
infra/conf/lint.go
Normal file
|
@ -0,0 +1,23 @@
|
|||
package conf
|
||||
|
||||
type ConfigureFilePostProcessingStage interface {
|
||||
Process(conf *Config) error
|
||||
}
|
||||
|
||||
var configureFilePostProcessingStages map[string]ConfigureFilePostProcessingStage
|
||||
|
||||
func RegisterConfigureFilePostProcessingStage(name string, stage ConfigureFilePostProcessingStage) {
|
||||
if configureFilePostProcessingStages == nil {
|
||||
configureFilePostProcessingStages = make(map[string]ConfigureFilePostProcessingStage)
|
||||
}
|
||||
configureFilePostProcessingStages[name] = stage
|
||||
}
|
||||
|
||||
func PostProcessConfigureFile(conf *Config) error {
|
||||
for k, v := range configureFilePostProcessingStages {
|
||||
if err := v.Process(conf); err != nil {
|
||||
return newError("Rejected by Postprocessing Stage ", k).AtError().Base(err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue