Solved

Client Ping via Javascript

Posted on 2008-06-25
5
1,575 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
I'm glad I could help.  Thanks for the grade, the points and the fun question.

bol
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article discusses how to create an extensible mechanism for linked drop downs.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to count occurrences of each item in an array.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.

771 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now