title: Dynamically get host and port in Alfresco Share webscript
body: <p>I'm wondering how could I get the host and port of the server where Share is running in, within a JS webscript. I have been searching both in Google and forums but I didn't find anything useful. I was also searching in the Share's source code with the same result. Is possible to do it?</p>
  
  <p>I've also been thinking about an alternative solution consisting in defining dynamically host an port in the component's config file, but I don't know whether it is possible or not.</p>
  
  <p>Did anybody do it before?</p>
  
  <p>Thanks.</p>