title: How to set source IP to http request?
body: <p>I need to set source IP address (for something like IP Spoofing) before sending out an http request. Class used for setting up http connection is <code>HTTPURLConnection</code>. I found below link on stackoverflow which is really useful.  </p>
  
  <p><a href="https://stackoverflow.com/questions/26363573/registering-and-using-a-custom-java-net-url-protocol">Registering and using a custom java.net.URL protocol</a></p>
  
  <p>As in the post, I have already created 3 classes extending <code>URLConnection</code> , <code>URLStreamHandler</code> and implementing <code>URLStreamHandlerFactory</code>. This looks to be working fine; however I am getting exception which I think is because I have not implemented <code>getInputStream</code> for <code>URLConnection</code> as was mentioned in above post.   </p>
  
  <p><strong>I have couple of questions</strong><br>
  1> I am extending custom <code>URLConnection</code> class from <code>HTTPURLConnection</code>, so what's the need of implementing <code>getInputStream</code> as anyway it's a virtual method<br>
  2> If I have to do it, can someone provide sample implementation of this method?</p>