Skip to content
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

Closed
wants to merge 4 commits into from

Conversation

arch3754
Copy link
Contributor

@arch3754 arch3754 commented Feb 7, 2024

headers没有必要重新定义,有map并发写问题
添加了http和https 建联ip指定的功能代替原生的proxy,解决https指定代理无法访问的问题

if err != nil {
return nil, err
}
//proxy, err := ins.Proxy()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

proxy 有问题?

Copy link
Contributor Author

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 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这些都去掉,老版本客户配置的headers 不要了?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个headers 有并发安全问题,原来就有一个httpConfig 的headers,不知道为啥多加了一层headers,还和原来结构不一致

Copy link
Collaborator

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格式,配置起来会更简单(其他插件有用到的)

@kongfei605
Copy link
Collaborator

这个插件先不要这么改,应该借鉴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" }
Copy link
Collaborator

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"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

看代码中应该是https_remote_addr

@kongfei605
Copy link
Collaborator

这个PR先close了, 后续借鉴black box的逻辑再重构一下,

应该借鉴black box的逻辑,像cookie 、fllow redirection都支持

@kongfei605 kongfei605 closed this Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants