Solved

Client Ping via Javascript

Posted on 2008-06-25
5
1,580 Views
Last Modified: 2008-06-30
Hello!

I need some way to ping an IP using javascript.  The ping has to come from the client, hence the JS dependency, and it should work just as if the client ran ping from their command prompt.  The solutions I've found work in the case that the pinged computer is running a web server, but when this is not the case the pingers will fail.  Does anyone know of a solution that should work for this?

Thanks!
0
Comment
Question by:RJBuild
  • 2
5 Comments
 
LVL 11

Expert Comment

by:spoxox
ID: 21869297
Any computer can be set up to refuse ping requests.

If you have a solution that works some times, don't bother trying to make it work for every target.
0
 

Author Comment

by:RJBuild
ID: 21869347
The issue is that the solution I have now works only when the server accepts web requests.  For example, I can ping experts-exchange.com via command line or the script, but if I try some location without a web server, the command line succeeds and the web script fails.

For example, google.com will work in both, but try ns.google.com, which succeeds at the command line, fails on the web page as there is no web server there.
0
 
LVL 54

Accepted Solution

by:
b0lsc0tt earned 500 total points
ID: 21904506
This can't be done just with Javascript.  If you want something that can work in any browser then look at making or finding an applet.  For example a Java applet.  If just an IE solution is sufficient then you could look at an ActiveX object.  The browser itself can't use clientside script to do this, especially based on the client.

Browser security does limit even applets and objects but they can do more if the user is willing to allow them to be downloaded or run.  Most of the times this is a one time warning.  A signed applet or object will be able to do more so you might have to have yours signed if you develop it yourself.

I don't know of a premade applet that will do this, which I could trust.  A google search will offer a number of results.  I'll be happy to try to help you find one if I can but I would recommend making your own, especially if this is something you will distribute to users/visitors and want them to trust.

Let me know if you have question or need more info.

bol
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 21904578
I'm glad I could help.  Thanks for the grade, the points and the fun question.

bol
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

New Relic: Our company recently started researching several products to figure out what were the best ways for us to increase our web page speed and to quickly identify performance problems that we may be having. One of the products we evaluated wa…
Developer tools in browsers have been around for a while, yet they are still heavily underused by developers. Developers still fix html or CSS then refresh page to see effect, or they put alert or debugger in JavaScript and then try again and again …
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question