Announcement

Collapse
No announcement yet.

HTTP.TestConnection and HTTPS

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Drag
    replied
    Thank you Ulrich for this pro solution, I placed the script on Global and
    The following on Page1 OnShow
    Code:
    if HTTP.TestConnection() == true then
       Page.Jump("Page2");
    else
       Page.Jump("Page3");
    end
    It works very fine and very quick.

    Only a question:
    Will that file, that url, be deleted in the future?

    Leave a comment:


  • Ulrich
    replied
    The sample project above still uses the built-in HTTP.TestConnection(). A more reliable way to check if there is a working internet connection is using Network Connectivity Status Indicator (NCSI). Below is a sample script to redefine HTTP.TestConnection() using this feature. As vBulletin blocks mentions of the command line interpreter in the body of posts, the Lua script is inserted here as an image and attached as a zipped source.

    Click image for larger version

Name:	SCRN-2019-06-03-01.png
Views:	225
Size:	47.2 KB
ID:	303432

    Add the definition of the custom HTTP.TestConnection() to the globals of your project, and no other modifications to the script is required. If the function returns true, you have working DNS and internet connectivity.

    Ulrich

    Leave a comment:


  • Drag
    replied
    Thanks, I will try!

    Leave a comment:


  • herrin
    replied
    -port 443 instead of 80
    -to test HTTPS upload a small file on the site and use HTTP.DownloadSecure to retrieve it. (suggestion of ulrich)


    yes it work

    Code:
    [ATTACH]n303429[/ATTACH]

    Leave a comment:


  • Drag
    replied
    Hi herrin, I already use that code.
    My question is regarding HTTP protocol instead of HTTPS.

    Does HTTP.TestConnection the job anyway or is there a dedicated HTTPS function?
    I'm using Google and it is HTTPS.

    Leave a comment:


  • herrin
    replied
    Code:
    IsConnected = HTTP.TestConnection("http://www.google.com", 20, 80, nil, nil); 
    if (IsConnected == true) then 
    Dialog.Message("Notice", "Internet connection was detected");
    else
    Dialog.Message("Notice", "No Internet connection was detected.");
    end

    Leave a comment:


  • Drag
    started a topic HTTP.TestConnection and HTTPS

    HTTP.TestConnection and HTTPS

    Hi IR Forum, a simple question,
    I'm wrong using this code assuming that Google is based on HTTPS?
    Code:
    connected = HTTP.TestConnection("http://www.google.com", 20, 80, nil, nil);
    Have you some more reliable and simple way?
    TNX!
Working...
X
😀
🥰
🤢
😎
😡
👍
👎