Skip to content

Commit

Permalink
Respect -dns flag when -https is enabled
Browse files Browse the repository at this point in the history
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`).
  • Loading branch information
2opremio committed Feb 28, 2021
1 parent 1a8c26f commit bad4b14
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,9 @@ func (p *Proxy) StartTLS(addr string) error {

p.srv = srv
p.ln = ln
p.rt = &http.Transport{}
p.rt = &http.Transport{
DialContext: p.dialContext,
}

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

0 comments on commit bad4b14

Please sign in to comment.