signageful / client

0 stars 0 forks source link

Implement an alternative solution for network connectivity check #7

Open juliankoehn opened 1 year ago

juliankoehn commented 1 year ago

Currently, the Digital Signage Player uses "ipv4.canihazip.com" to check for an internet connection. However, relying on a third-party service is not a sustainable solution as it may not always be available.

To ensure the reliability and stability of the player, it is important to implement an alternative solution for network connectivity check. One potential solution could be using a custom URL such as "ipv4.signageful.com".

Please let me know your thoughts on this proposal and if you need any further information. Thank you!

ankits57 commented 1 year ago

I was thinking of using jQuery and Ajax to do something similar, like it will run a script and check from your own domain, actually i did something similar in the past, so I am pasting sample code over here, feel free to make modifications.

Explanation : Website has a button which when clicked redirects to a particular websites to check connection and return the response back to user, u can choose whichever website u want.

Code:

<button id="checkBtn">Check Connectivity</button>

<script> $(document).ready(function() { $("#checkBtn").click(function() { $.ajax({ url: "https://www.example.com", type: "HEAD", timeout: 5000, success: function() { alert("Connected"); }, error: function() { alert("Not Connected"); } }); }); }); </script>