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

feat: Support proxy config and env vars for HTTP, TCP and TLS Probers #194

Merged
merged 9 commits into from
Aug 16, 2022

Conversation

haoel
Copy link
Contributor

@haoel haoel commented Aug 12, 2022

close #193

Code changes:

  • Add the proxy configuration to support socks5 proxy for TLS and TCP probes.
  • Support the $ALL_PROXY environment variable for TLS and TCP probes.
  • Support the $HTTP_PROXY and $HTTPS_PROXY environment variable for HTTP probe

@codecov-commenter
Copy link

codecov-commenter commented Aug 12, 2022

Codecov Report

Merging #194 (5973289) into main (46f758f) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #194      +/-   ##
==========================================
+ Coverage   94.40%   94.44%   +0.03%     
==========================================
  Files          49       49              
  Lines        4025     4051      +26     
==========================================
+ Hits         3800     3826      +26     
  Misses        157      157              
  Partials       68       68              
Impacted Files Coverage Δ
eval/extract.go 100.00% <ø> (ø)
probe/http/http.go 96.53% <ø> (ø)
probe/base/base.go 100.00% <100.00%> (ø)
probe/tcp/tcp.go 100.00% <100.00%> (ø)
probe/tls/tls.go 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@proditis proditis left a comment

Choose a reason for hiding this comment

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

I couldnt get the socks5 to work with environment variables, but i am not sure i tested right. every format combination i tried with ALL_PROXY had no effect.
HTTP_PROXY and HTTPS_PROXY work as expected each affects only their corresponding protocol.

README.md Outdated Show resolved Hide resolved
@haoel
Copy link
Contributor Author

haoel commented Aug 13, 2022

I couldnt get the socks5 to work with environment variables, but i am not sure i tested right. every format combination i tried with ALL_PROXY had no effect. HTTP_PROXY and HTTPS_PROXY work as expected each affects only their corresponding protocol.

By using the following command, you can create a SOCKS5 proxy. then you can set ALL_PROXY=socks5://127.0.0.1:1080

ssh -D 1080 -qCN [email protected]

Besides, you can set a wrong socks5 server, such as ALL_PROXY=socks5://127.0.0.1:1024, and you can see the error message dial tcp 127.0.0.1:1024: connect: connection refused for TCP or TLS probe.

@zhao-kun zhao-kun merged commit f4fab9a into megaease:main Aug 16, 2022
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.

能给 TLS Probe Configuration 加上 http proxy 和 自定义 useragent 吗? 谢谢
5 participants