title: Get IPv4 Address from python, even with vpn on
body: <p>So I'm using socket to connect clients to the server. For that, I need the computer's ip. Currently, the best way I found is this:</p>
  
  <pre><code>socket.gethostbyname(socket.gethostname())
  </code></pre>
  
  <p>I then use requests to tell my clients about my ip, and they connect. The issue here is that when my vpn is on, I get another host and that causes the clients to be unable to connect.
  But when I open command prompt and type ipconfig, I get the correct ip regardless of the vpn status. So I need to get the same ip as would be shown under IPv4 in command prompt, is this possible in python? </p>
  
  <p>I'm trying to get the server to work on any device regardless of exceptions such as this.</p>
  
  <p>Thanks!</p>