Answer the question
In order to leave comments, you need to log in
How to send a POST request from a specific IP address?
There are several external ip, how to send a request from a specific one?
Answer the question
In order to leave comments, you need to log in
You need to create a client with a specific dialer
localAddr, err := net.ResolveIPAddr("ip", "192.168.1.2")
if err != nil {
panic(err)
}
localTCPAddr := net.TCPAddr{
IP: localAddr.IP,
}
client := &http.Client{
Transport: &http.Transport{
Dial: (&net.Dialer{
LocalAddr: localTCPAddr,
}).Dial,
},
}
Raise the proxy which specify the desired address to the outside and send through it :)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question