mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-01-23 02:34:42 +00:00
Set coordinator server address to :http for cloudretro
This commit is contained in:
parent
db8bc62958
commit
904b0ae1bb
2 changed files with 8 additions and 8 deletions
|
|
@ -1,3 +1,4 @@
|
|||
CLOUD_GAME_COORDINATOR_SERVER_ADDRESS=
|
||||
CLOUD_GAME_COORDINATOR_SERVER_HTTPS=true
|
||||
CLOUD_GAME_COORDINATOR_SERVER_TLS_DOMAIN=cloudretro.io
|
||||
CLOUD_GAME_ENVIRONMENT=prod
|
||||
|
|
|
|||
|
|
@ -117,15 +117,15 @@ func (s *Server) GetProtocol() string {
|
|||
}
|
||||
|
||||
func (s *Server) redirection() (*Server, error) {
|
||||
address := s.Addr
|
||||
if s.opts.HttpsDomain != "" {
|
||||
address = s.opts.HttpsDomain
|
||||
}
|
||||
addr := buildAddress(address, s.opts.Zone, *s.listener)
|
||||
|
||||
srv, err := NewServer(s.opts.HttpsRedirectAddress, func(serv *Server) http.Handler {
|
||||
h := http.NewServeMux()
|
||||
|
||||
address := s.Addr
|
||||
if s.opts.HttpsDomain != "" {
|
||||
address = s.opts.HttpsDomain
|
||||
}
|
||||
addr := buildAddress(address, s.opts.Zone, *s.listener)
|
||||
|
||||
h.Handle("/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
httpsURL := url.URL{Scheme: "https", Host: addr, Path: r.URL.Path, RawQuery: r.URL.RawQuery}
|
||||
rdr := httpsURL.String()
|
||||
|
|
@ -137,9 +137,8 @@ func (s *Server) redirection() (*Server, error) {
|
|||
if serv.autoCert != nil {
|
||||
return serv.autoCert.HTTPHandler(h)
|
||||
}
|
||||
|
||||
return h
|
||||
})
|
||||
log.Printf("Starting HTTP->HTTPS redirection server on %s", srv.Addr)
|
||||
log.Printf("Starting HTTP->HTTPS redirection server on %s", addr)
|
||||
return srv, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue