point-source / dart_ping

Multi-platform network ping utility for Dart
31 stars 14 forks source link

Add support for JS #15

Closed guyluz11 closed 3 years ago

guyluz11 commented 3 years ago

We are missing support for JS.

image

image

Can we add support for it?.

point-source commented 3 years ago

As far as I am aware, this is not currently possible. There are a couple methods that people can use to fake it / simulate it, but I don't believe there is a way to send a true ICMP echo packet over a local network from a browser via js. This is due to a couple of reasons:

For additional context, another user asked me about this here and we discussed this for a bit.

Finally, something you can do, is make a network request against the network device in question and report if it succeeds / connects or not. If you know for sure that the device is designed to reply as well as which port it expects to receive requests on, this can work. If you are just trying to perform a network scan, this will likely fail since most devices do not run arbitrary web servers on arbitrary ports.

If you have an idea about how we can workaround or otherwise implement this feature, I'm happy to consider it. Thanks!

guyluz11 commented 3 years ago

Thank you for your detailed reply, for now I will close this issue as I understand that it is not possible.

In my case I am doing the request to a server in the same network with a specific port open, so I will reopen this issue in case I have more questions about how to pig to it.

Thanks