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

goproxy not working when set as https_proxy #479

Open
k-p-ani opened this issue Jul 6, 2022 · 2 comments
Open

goproxy not working when set as https_proxy #479

k-p-ani opened this issue Jul 6, 2022 · 2 comments

Comments

@k-p-ani
Copy link

k-p-ani commented Jul 6, 2022

Hi,
When i start goproxy instance at 8080 and then try to connect a target secured site with https scheme, I observed that
proxy.OnRequest().DoFunc is never called. Below is how I call the secured target site after setting https_proxy variable, this variable points to my goproxy instance running at port 8080.

https_proxy=http://0.0.0.0:8080 wget https://webhook.site/f227e786-e662-429c-8e69-dc8c57e2249e --header="Content-Type: text/json" --post-file=/home/ubuntu/go/src/warden-proxy/mydata.json


Out put of above wget execution is as below

--2022-07-06 10:17:47-- https://webhook.site/f227e786-e662-429c-8e69-dc8c57e2249e
Connecting to 0.0.0.0:8080... connected.
Proxy request sent, awaiting response... 200 OK

Length: unspecified [text/plain]
Saving to: ‘f227e786-e662-429c-8e69-dc8c57e2249e’



goproxy console output as below

2022/07/06 10:17:47 [001] INFO: Running 1 CONNECT handlers
2022/07/06 10:17:47 [001] INFO: Accepting CONNECT to webhook.site:443



DoFunc implementation

`proxy.OnRequest().DoFunc(

            func(r *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http.Response) {
		log.Println("on request called")
		r.Header.Set("X-GoProxy", "yxorPoG-X")
		return r, nil
	})
	`

Thanks in advance.

@faf-xff
Copy link

faf-xff commented Nov 7, 2022

你解决了吗

@faf-xff
Copy link

faf-xff commented Nov 7, 2022

可能是因为少写了
proxy.OnRequest().HandleConnect(goproxy.AlwaysMitm)

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

No branches or pull requests

2 participants