www.webdeveloper.com
Results 1 to 7 of 7

Thread: Javascript Port Testing

  1. #1
    Join Date
    Jan 2012
    Posts
    6

    Javascript Port Testing

    I need to be able to test if a client has port 80 and port 1935 open and configured properly on their machine using javascript. I have googled my brains out and I can't seem to find the info I am looking for. How would you accomplish this?

  2. #2
    Join Date
    Mar 2012
    Location
    Saint-Petersburg, Russia
    Posts
    97
    Funny. If you googled at least 5 minutes, you should find that there is no any means to accomplish this by javascript on browser side.

    Moreover, you should understand that if port on client's machine is opened this does not mean you can access it from outside, because port should be forwarded by router via which client is linked to internet etc. So in most case you may test only specific port of router which has worldwide IP but you will not see (by usual means at least) to which port on which of the machines behind router this port is forwarded.

  3. #3
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    What exactly are you trying to accomplish?
    Jon Wire

    thepointless.com | rounded corner generator

    I agree with Apple. Flash is just terrible.

    Use CODE tags!

  4. #4
    Join Date
    Jan 2012
    Posts
    6
    My boss wants a page that can do something similar to the following

    http://www.rocket9broadcasting.com/systemtest/resolve/

    Under "Is your firewall blocking the flash stream". I don't know anything about flash, so I am looking to do this in something I am more familiar with.

  5. #5
    Join Date
    Mar 2012
    Posts
    202
    @svidgen good question

    Are you trying to code JavaScript for use with internet browsers? If so, then stop trying to ask questions because even if it is possible nobody will help you, at least not for free. Modern browsers have security settings that prevents things like this from happening.

    There may be some sort of ActiveX control that may work with modern Internet Explorer browsers, but what you are asking is something that should be only done automatically in owned network environments anyways, making that option in almost every case completely unnecessary.

    You may be able to code some .js files that would have to be distributed through to each client that accesses and returns information from command prompt executables. The distribution for .js files to clients is usually done through "Group Policies". In this case, JScript can be used to do what you want accomplished, and AJAX could also be used to centralize the information on a server.

    Here is a link to an MSDN resource for using JScript to run command-line executables and get the results. http://msdn.microsoft.com/en-us/library/cbxxzwb5%28v=vs.85%29.aspx

  6. #6
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    Looks like your test page isn't testing access to local ports, but remote ports. I just briefly skimmed the wiki page on the protocol it's testing, and it appears as though the client establishes the connection with the server. I validated this hypothesis to some extent by setting my machine's firewall was aggressively reject all incoming connections -- still passed.

    If you really need JavaScript to test this for you, you can do it by making standard AJAX requests to the ports in question. But, it seems more likely that, given the ports you want to test, your target client app is going to be written in Flash anyway. So, why not use flash for your tests too?
    Jon Wire

    thepointless.com | rounded corner generator

    I agree with Apple. Flash is just terrible.

    Use CODE tags!

  7. #7
    Join Date
    Mar 2012
    Posts
    202
    Assuming it is a PHP server you have access to, you can use the PHP server could handle the part that JavaScript can't then use AJAX to send/recieve the necessary information. The hard part has already been handled for you apparently:

    http://www.durgle.com/projects/code/ajaxportscanner/

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles