-2

A program I'm developing connects directly over the LAN between 2 computers. Sometimes, a user will have 2 computers on different networks, so the computers won't be able to connect to each other (or ping each other). I want to give the user the possibility of testing this LAN-to-LAN connectivity before downloading and installing the main program.

Is it possible to or connect to (or ping) one computer from another over LAN using Chrome or any other browser? This would also involve detecting the local IP address.

My hunch is that Chrome (and other browsers) won't provide this sort of access to the OS (i.e. with JavaScript or an extension), but maybe there's an alternative (dare I say, a Java Applet, if that's still a thing). A bonus would be if this could work on Windows, macOS, and Linux.

Any ideas?

notjoshno
  • 337
  • 2
  • 4
  • 15
Nick Bolton
  • 38,276
  • 70
  • 174
  • 242
  • Ping is an application, just like Chrome is an application. – Ron Maupin Nov 16 '18 at 14:35
  • Indeed, this is an example. Maybe it's possible to create a socket for another computer to listen to? What about querying the IP address or hostname? Any ideas? – Nick Bolton Nov 16 '18 at 14:38
  • Does it have to be Chrome? Can you just create a process to ping the other computer? – Ron Trunk Nov 16 '18 at 20:15
  • The user downloads the app from a web browser, so it'd be more seamless if they didn't have to install a program or run a process manually. It'd be great if I could run a Chrome extension that creates a TCP socket or something... – Nick Bolton Nov 16 '18 at 21:20
  • @RonMaupin Maybe Chrome Sockets? https://developer.chrome.com/apps/sockets_tcp – Nick Bolton Nov 16 '18 at 21:23

3 Answers3

1

Found this question:

Can You Get A Users Local LAN IP Address Via JavaScript?

Which has an answer linking to:

net.ipcalf.com

If you hit F12 you can look at the source code and attempt to reverse engineer it, but I recommend researching it independently as well.

Nick Bolton
  • 38,276
  • 70
  • 174
  • 242
notjoshno
  • 337
  • 2
  • 4
  • 15
0

Is it possible to or connect to (or ping) one computer from another over LAN using Chrome or any other browser?

Chrome Sockets, perhaps. Though I have no idea how.

Nick Bolton
  • 38,276
  • 70
  • 174
  • 242
0

This would also involve detecting the local IP address.

This Chrome extension shows your local IPs: Show My IP Addresses (External and Local)

I wonder how this works...

Nick Bolton
  • 38,276
  • 70
  • 174
  • 242