Skip to content

Commit bad4b14

Browse files
committed
Respect -dns flag when -https is enabled
This change makes the `-dns` flag be respected with the `-https` flag Before this change the `sudo hyperfox -ui -http 80 -dns 8.8.8.8` -> `curl http://example.com` lead to an infinite request loop when `-https` was also supplied (i.e. `sudo hyperfox -ui -http 80 -https 443 -dns 8.8.8.8`).
1 parent 1a8c26f commit bad4b14

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/proxy/proxy.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,9 @@ func (p *Proxy) StartTLS(addr string) error {
412412

413413
p.srv = srv
414414
p.ln = ln
415-
p.rt = &http.Transport{}
415+
p.rt = &http.Transport{
416+
DialContext: p.dialContext,
417+
}
416418

417419
log.Printf("Listening for HTTP requests at %s (SSL/TLS mode)\n", addr)
418420
if err := p.srv.Serve(tlsListener); err != nil {

0 commit comments

Comments
 (0)