My website runs on a public web server A which does not see my local server B located on my intranet. In my browser, if I am in my office, I can access my intranet in the address field of my browser. I can also display an image located in my local server B on a page built from my web server A. However if I use file_exists(file on server B) in php running on server A, it does not work as the php script is running on server A which does not see server B.
I need to detect if the browser can access server B (is in the office or tunnelling via vpn) so I can decide if I display/download the local files on server B or the files on the web server A. How can I do that?
I also need that function to see if I can call my asterisk server to place a call on my pabx.