Results 1 to 2 of 2

Thread: Ping a server with Javascript??

  1. #1
    Join Date
    Mar 2010
    Location
    Canada
    Posts
    32
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Ping a server with Javascript??

    Is it possible to ping a server from a client to server side. Using Javascript. I checked the web and couldn't find anything.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Pinging is accomplished at the OS level of the client. This cannot be easily reached by javascript. Active X or Java, perhaps others could theoretically be used. However, since the browser cannot know that all you want is an innocent ping, it will be blocked unless you have a certification. These are generally obtained from a third party, aren't cheap, and require annual maintenance fees. Utilizing them for something like this would add a level of complexity to the script code. They are most often used for e-commerce (https), where their utilization is generally more transparent/intuitive. There are different kinds. What you would need for this is probably different than that for an ssl (https).

    You can use javascript to tell the browser to download an image, and even time how long it takes. Divide the number of bytes by the length of time it takes to download it and you can get bps (bytes per second) or bpms (bytes per millisecond), the sort of information that you might want from a ping.

    If this is of interest to you, would satisfy your needs here, I can throw together some code for it.

    If there's some other information you are after, let me know what it is. There may be a way to get at that as well.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •