Announcement

Collapse
No announcement yet.

HTTP.TestConnection + https

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

  • HTTP.TestConnection + https

    Recently the URL that I was checking for an Internet connection switched from http to https. So I changed the line of code below from:

    Code:
    local bConnected = HTTP.TestConnection("http://mywebsite.com.au", 20, 80, nil, nil);
    to:

    Code:
    local bConnected = HTTP.TestConnection("https://mywebsite.com.au", 20, 443, nil, nil);
    But this always reports failed

    Is the HTTP.TestConnection supposed to work with URLs that use https? Perhaps I have the incorrect syntax?

  • #2
    HTTP.TestConnection() uses the HTTP protocol, which uses normally the port 80, but it also may use a different port. You cannot use this action to test connectivity to a HTTPS web server, because this is a different protocol, not implemented in this action.

    If you just want to know if the computer has an active internet connection, I suggest using another well known URL, such as http://www.google.com.

    If you absolutely need to know if the HTTPS web server is up and running, I would place a very small txt file somewhere and attempt to download it. If the download fails, you could assume that the server is currently unreachable.

    Ulrich

    Comment


    • #3
      Thanks Ulrich.

      I have gone with your suggestion and testing that well know URL

      Comment

      Working...
      X