config.go 481 B

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