Im looking for a script that will do something like a ping in the background while connected to a web app. Keep alive? I've looked into greasemonkey which uses javascript and have considered a python script. Im a babe, I know very little Python and hardly nothing about javascript. Can someone educate me? I need the script to keep a security checkin app from timing out and dropping connection to the host. The script will be a temporary fix because the real issue is network related.
Asked
Active
Viewed 119 times
0
-
Possible duplicate of [Is it possible to ping a server from Javascript?](http://stackoverflow.com/questions/4282151/is-it-possible-to-ping-a-server-from-javascript) – woofmeow Aug 08 '13 at 02:19
1 Answers
0
It kinda depends on the app you're trying to stay connected to, but if you go with javascript, you can set up a timeInterval and have it make an ajax call to one of the web app's exposed api urls. The url and parameters of the ajax call really depend on the web app you're trying to stay connected to.
setInterval(function () {
$.ajax({
type: 'POST',
url: "[web_app_uri]/check_in_method",
data: JSON.stringify(parameters_for_method)
});
}, 1000 * 60);

Fuzzley
- 306
- 2
- 8