|
@@ -8,18 +8,20 @@ import (
|
|
|
)
|
|
|
|
|
|
type HttpServerConfig struct {
|
|
|
- HttpPort int `json:"http_port"`
|
|
|
- HttpsPort int `json:"https_port"`
|
|
|
- AllowedDomain string `json:"allowed_domain"`
|
|
|
- FullDomain string // The domain name with the protocol before it
|
|
|
- Proto string `json:"proto"` // http/https
|
|
|
- UserAgent string `json:"user_agent"`
|
|
|
- UseSsl bool `json:"use_ssl"`
|
|
|
- ProxyAddr string `json:"proxy_addr"`
|
|
|
- FullProxyDomain string // the domain name of the proxied site with the protocol
|
|
|
- CookieJar []*http.Cookie
|
|
|
- PhpSession *http.Cookie
|
|
|
- SsoToken *http.Cookie
|
|
|
+ HttpPort int `json:"http_port"`
|
|
|
+ HttpsPort int `json:"https_port"`
|
|
|
+ AllowedDomain string `json:"allowed_domain"`
|
|
|
+ FullDomain string // The domain name with the protocol before it
|
|
|
+ AltAllowedDomain string `json:"alt_allowed_domain"` // alternate domain that resources are sourced from
|
|
|
+ FullAltAllowedDomain string // the alt domain with the protocol
|
|
|
+ Proto string `json:"proto"` // http/https
|
|
|
+ UserAgent string `json:"user_agent"`
|
|
|
+ UseSsl bool `json:"use_ssl"`
|
|
|
+ ProxyAddr string `json:"proxy_addr"`
|
|
|
+ FullProxyDomain string // the domain name of the proxied site with the protocol
|
|
|
+ CookieJar []*http.Cookie
|
|
|
+ PhpSession *http.Cookie
|
|
|
+ SsoToken *http.Cookie
|
|
|
}
|
|
|
|
|
|
type Cookie struct {
|
|
@@ -55,6 +57,7 @@ func ReadConfig(loc string) (*HttpServerConfig, error) {
|
|
|
}
|
|
|
cfg.FullDomain = fmt.Sprintf("%s://%s", cfg.Proto, cfg.AllowedDomain)
|
|
|
cfg.FullProxyDomain = fmt.Sprintf("%s://%s", cfg.Proto, cfg.ProxyAddr)
|
|
|
+ cfg.FullAltAllowedDomain = fmt.Sprintf("%s://%s", cfg.Proto, cfg.AltAllowedDomain)
|
|
|
var cookies []Cookie
|
|
|
err = json.Unmarshal(cf, &cookies)
|
|
|
if err != nil {
|