mirror of
https://github.com/fatedier/frp.git
synced 2026-07-18 19:59:19 +08:00
feat(proxy): add HTTP to HTTPS redirection support
This commit is contained in:
@@ -291,8 +291,14 @@ func NewService(cfg *v1.ServerConfig) (*Service, error) {
|
||||
|
||||
// Create http vhost muxer.
|
||||
if cfg.VhostHTTPPort > 0 {
|
||||
var redirector *vhost.HTTPSRedirector
|
||||
if cfg.VhostHTTPSPort > 0 {
|
||||
redirector = vhost.NewHTTPSRedirector(cfg.VhostHTTPSRedirectPort)
|
||||
svr.rc.HTTPSRedirector = redirector
|
||||
}
|
||||
rp := vhost.NewHTTPReverseProxy(vhost.HTTPReverseProxyOptions{
|
||||
ResponseHeaderTimeoutS: cfg.VhostHTTPTimeout,
|
||||
HTTPSRedirector: redirector,
|
||||
}, svr.httpVhostRouter)
|
||||
svr.rc.HTTPReverseProxy = rp
|
||||
|
||||
|
||||
Reference in New Issue
Block a user