Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.0k views
in Technique[技术] by (71.8m points)

JavaScript Check for HTTP Server on Local Network

I am currently working on a device that would connect to a Wi-Fi network and then host an HTTP server on the local network that you can connect to and configure the device. The problem is that the only way to access the device would be through its local IP. I'd like to make a program in JavaScript that would automatically check each device on the local network and determine the local IP of the device hosting the HTTP server and then redirect to it. Is there a way to do this? According to this answer it is possible to detect if a port is open using something like <img src="http://192.168.1.1/favicon.ico" onload="alert('Yay')" onerror="alert('No')">. Is this a good way of achieving this, and how would I apply this to scanning an entire network? Thanks


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...