Is it possible for a desktop app to simply test that a Web App is up and running remotely? I have tried to hit my site that is a Xojo standalone web app from a desktop app using httpsocket.get and am getting a 103 error. Is there any other way to communicate? Basically I am wanting to have my own application ensure my site is working. Any ideas?
Call the SpecialURL of the web app from your desktop app.
So I will need to display the SpecialURL in my web app so I can see what it is. Then have the desktop app check that url?
I see I am going to have to add code to my webapp to respond to requests to the SpecialURL. Which really doesn’t test what I wanted. Unless I guess I write code to check and make sure my database is accessible and responds and the fact that the app responds should in essence make me feel 99.9% sure my website is working. But in the end is not REALLY telling me that I am going to get my login page from a browser.
Well, you could send some simple command to the database and if you get a response and no database errors you should be okay. I can’t imagine a situation where the special URL would work but a session couldn’t get started.
In standalone builds it will fail if the app isn’t running or the database can’t be connected to. It also wouldn’t create a login page.
If you are on a Mac or Linux server you could probably do something with LaunchD to periodically check if the standalone app is running and restart it if it’s not. I’m not a guru in that area so I can’t be of much help. Also not sure what do about a Windows service app.
In cgi builds, if the app isn’t running it should spin up and pass as long as the database can connect. The login page should be accessible then.
Come to think about it, you should be able to get the HTTPSocket Get to work. Your error 103 is a ‘name resolution error’ so it could that you don’t have the right IP address or port.
Its running on Port 80 and I even tried the direct internal address of the machine as my URL. With a url of “http://192.168.15.146” I am getting a 103 error returned, when in a browser I get a login page.
I was curious about this so knocked up this project which seems to work well on both cgi & standalong WE sites.
- Are you using the same URL as you would with a browser ?
- Have you tried entering another URL such as http://xojo.com ? Does it display fine ?
I am unable to access your test project.
[quote=67961:@Michel Bujardet]- Are you using the same URL as you would with a browser ?
- Have you tried entering another URL such as http://xojo.com ? Does it display fine ?[/quote]
I do believe there must be something wrong with my test project as you are correct I am getting a 103 with any site I try to access.
False alarm everyone, somehow my httpsocket got set to use port 8888 rather than 80 therefore no response! Works now just fine! Now to add a timer to test connecting on an interval.
What was going to be my next suggestion to double check the port the socket was using. Guess you beat me to it…
What about “Mutex” could it be an alternative ?