title: get server address from bottle
body: <p>Is it possible to get the IP Address of the server programmaticaly in a bottle request?</p>
  
  <p>I need to return a link to a file on the server inside a request and need to know the IP. Bottle will be started on a server with different IPs and all of these IPs will be serve requests.</p>
  
  <p>currently i looks like this:</p>
  
  <pre><code>from bottle import *
  import json
  @get('/file')
  def getAFileLink():
      # some logic here for the right filename to return
      # server runs now on e.g. 10.0.0.1 and 10.10.0.1
      # every client should see the IP from the server in the right subnet
      return json.dumps({'url': 'http://127.0.0.1:1337/some/file.abc'})
  
  @route('/some/&lt;filename&gt;')
  def getStaticFile(filename):
      return static_file(filename, root="/srv/static/files")
  
  if __name__ == "__main__":
      run(host='0.0.0.0', port=1337)
  </code></pre>