v2ray-core/proxy/http/config.go

32 lines
481 B
Go
Raw Normal View History

2015-12-14 16:26:29 +00:00
package http
2016-01-26 10:28:09 +00:00
import (
2016-05-07 08:06:12 +00:00
"crypto/tls"
2016-01-26 10:28:09 +00:00
v2net "github.com/v2ray/v2ray-core/common/net"
)
2016-05-07 08:06:12 +00:00
type CertificateConfig struct {
Domain string
Certificate tls.Certificate
}
2016-04-25 13:30:28 +00:00
type TlsConfig struct {
2016-05-07 08:06:12 +00:00
Enabled bool
Certs []*CertificateConfig
2016-04-25 13:30:28 +00:00
}
type Config struct {
2016-04-25 13:30:28 +00:00
OwnHosts []v2net.Address
TlsConfig *TlsConfig
2016-01-26 10:28:09 +00:00
}
func (this *Config) IsOwnHost(host v2net.Address) bool {
for _, ownHost := range this.OwnHosts {
if ownHost.Equals(host) {
return true
}
}
return false
2015-12-14 16:26:29 +00:00
}