I am developing an application that has to connect through a HTTP Proxy and then use that Connection to do a GET Request to a domain name. The Domain Name should be resolved manually e.g. giving it the IP it should dial. Exactly thats the issue im facing.
prox, err := connectproxy.NewWithConfig(urll, proxy.Direct, &connectproxy.Config{
ServerName: requestHostname,
InsecureSkipVerify: true,
Header: hd,
})
tcpConn, err := prox.Dial("tcp", "customhostname.net:443")
req, _ := http.NewRequest("POST", "https://customhostname.net/auth", bytes.NewBuffer([]byte(str)))
req.Header.Set("Host", "customhostname.net:443")
With the above code the IP Address is being resolved automatically using DNS. How can i feed the client with my own IP?
Packages used: "golang.org/x/net/proxy" "github.com/magisterquis/connectproxy"
Thanks in advance.