反向代理实现AutoFlush

This commit is contained in:
刘祥超
2020-09-27 18:41:21 +08:00
parent af53fe6610
commit 55d3cd8d90
5 changed files with 60 additions and 48 deletions

View File

@@ -20,7 +20,6 @@ type HTTPLocationConfig struct {
IsBreak bool `yaml:"isBreak" json:"isBreak"` // 终止向下解析
Children []*HTTPLocationConfig `yaml:"children" json:"children"` // 子规则
CondGroups []*shared.HTTPRequestCondGroup `yaml:"condGroups" json:"condGroups"` // 匹配条件 TODO
AutoFlush bool `yaml:"autoFlush" json:"autoFlush"` // 自动Flush TODO
patternType HTTPLocationPatternType // 规则类型LocationPattern*
prefix string // 前缀

View File

@@ -12,7 +12,7 @@ type HTTPWebConfig struct {
Charset *HTTPCharsetConfig `yaml:"charset" json:"charset"` // 字符编码
Shutdown *HTTPShutdownConfig `yaml:"shutdown" json:"shutdown"` // 临时关闭配置
Pages []*HTTPPageConfig `yaml:"pages" json:"pages"` // 特殊页面配置
RedirectToHttps *HTTPRedirectToHTTPSConfig `yaml:"redirectToHttps" json:"redirectToHttps"` // 是否自动跳转到Https
RedirectToHttps *HTTPRedirectToHTTPSConfig `yaml:"redirectToHTTPS" json:"redirectToHTTPS"` // 是否自动跳转到Https
Root *HTTPRootConfig `yaml:"root" json:"root"` // 资源根目录 TODO
MaxRequestBodySize string `yaml:"maxRequestBodySize" json:"maxRequestBodySize"` // 请求body最大尺寸 TODO 需要实现
AccessLogRef *HTTPAccessLogRef `yaml:"accessLog" json:"accessLog"` // 访问日志配置

View File

@@ -21,6 +21,8 @@ type ReverseProxyConfig struct {
RequestHost string `yaml:"requestHost" json:"requestHost"` // 请求Host支持变量
RequestURI string `yaml:"requestURI" json:"requestURI"` // 请求URI支持变量如果同时定义了StripPrefix则先执行StripPrefix
AutoFlush bool `yaml:"autoFlush" json:"autoFlush"` // 是否自动刷新缓冲区在比如SSEserver-sent events场景下很有用
requestHostHasVariables bool
requestURIHasVariables bool