-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix:http_response headers concurrent map writes and add dial remote addr #795
Conversation
if err != nil { | ||
return nil, err | ||
} | ||
//proxy, err := ins.Proxy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
proxy 有问题?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
proxy无法代理https的请求
@@ -242,12 +242,7 @@ func (ins *Instance) httpGather(target string) (map[string]string, map[string]in | |||
return nil, nil, err | |||
} | |||
|
|||
// compatible with old config | |||
for i := 0; i < len(ins.Headers); i += 2 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这些都去掉,老版本客户配置的headers 不要了?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个headers 有并发安全问题,原来就有一个httpConfig 的headers,不知道为啥多加了一层headers,还和原来结构不一致
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instance的header是老的用法,http common config中的header 是map格式,配置起来会更简单(其他插件有用到的)
这个插件先不要这么改,应该借鉴black box的逻辑,像cookie 、fllow redirection都支持 |
@@ -38,7 +37,7 @@ targets = [ | |||
# password = "pa$$word" | |||
|
|||
## Optional headers | |||
# headers = ["Header-Key-1", "Header-Value-1", "Header-Key-2", "Header-Value-2"] | |||
# headers = { "Accept-Encoding" = "Gzip" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个地方不建议修改。 这里用法是 配对使用,修改成这样,不容易看出来用法。
# use_tls = false | ||
# use_tls = true | ||
## Set https conn remote addr(required use_tls) | ||
# tls_remote_addr = "10.10.10.10:443" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
看代码中应该是https_remote_addr
这个PR先close了, 后续借鉴black box的逻辑再重构一下,
|
headers没有必要重新定义,有map并发写问题
添加了http和https 建联ip指定的功能代替原生的proxy,解决https指定代理无法访问的问题