config.go 387 B

12345678910111213141516171819202122232425
  1. package http
  2. import (
  3. v2net "github.com/v2ray/v2ray-core/common/net"
  4. )
  5. type TlsConfig struct {
  6. Enabled bool
  7. CertFile string
  8. KeyFile string
  9. }
  10. type Config struct {
  11. OwnHosts []v2net.Address
  12. TlsConfig *TlsConfig
  13. }
  14. func (this *Config) IsOwnHost(host v2net.Address) bool {
  15. for _, ownHost := range this.OwnHosts {
  16. if ownHost.Equals(host) {
  17. return true
  18. }
  19. }
  20. return false
  21. }