简体   繁体   English

通过网页与本地计算机进行通信

[英]Communicate with the local machine from a web page

We have a web application. 我们有一个Web应用程序。 There are physical devices that we need to be able to communicate with, and we have access to all of our clients computers to install whatever software we need. 我们需要能够与之通信的物理设备,并且我们可以访问所有客户端计算机以安装我们需要的任何软件。 Now, for the question: Is there a way to make this browser-agnostic? 现在,对于这个问题:有没有办法使这个浏览器无关? As in, not requiring ActiveX controls? 在,不需要ActiveX控件?

One of my ideas was to install a custom made webserver on each client and then have javascript on our webpage that communicates with that webserver. 我的一个想法是在每个客户端上安装一个自定义的Web服务器,然后在我们的网页上使用javascript与该网络服务器进行通信。 This could be done by the same way that http://earlz.biz.tm javascript can access subdomains assigned to 127.0.0.1 such as http://loopback.earlz.biz.tm The problem with this of course is that the client's custom made webserver would be forced to run on port 80(which will have conflicts at least sometimes), or we would have to use a nonstandard port for our web application, which is quite undesirable. 这可以通过http://earlz.biz.tm javascript访问分配给127.0.0.1的子域名的方式来完成,例如http://loopback.earlz.biz.tm 。这当然是客户端的问题定制网络服务器将被强制在端口80上运行(至少有时会产生冲突),或者我们必须为我们的Web应用程序使用非标准端口,这是非常不受欢迎的。

Does anyone else have ideas on how to do this? 有没有其他人有关于如何做到这一点的想法?

Just to clarify. 只是为了澄清。 Our clients will be using regular PCs with Windows. 我们的客户将使用带有Windows的普通电脑。 We need to communicate with physical devices through these PCs. 我们需要通过这些PC与物理设备进行通信。 One such thing is a signature pad. 一个这样的东西是签名板。 So we want for people to be able to sign the signature pad and it show up in the web page. 因此,我们希望人们能够签署签名板并将其显示在网页中。

I don't think browser-based is the solution for this. 我不认为基于浏览器的解决方案。 There are too many security issues. 安全问题太多了。 You're better off writing a desktop application that incorporates some web functionality. 您最好编写一个包含一些Web功能的桌面应用程序。

I think web servers and possibly comet is the way to go. 我认为Web服务器和可能的彗星是要走的路。

Web servers can run on any port you like, as long as there aren't any firewalls blocking the ports, or they are configured to allow http traffic to pass through on different ports. Web服务器可以在您喜欢的任何端口上运行,只要没有任何防火墙阻止端口,或者它们被配置为允许http流量通过不同的端口。 Although theres nothing wrong with just using port 80 either. 虽然使用端口80也没有错。

On the mini web server you will then need to interact with the device. 在迷你Web服务器上,您将需要与设备进行交互。 You mention you are a .net shop, so you will probably have to install linux and apache + mono on these devices - not sure if this is feasible. 你提到你是一个.net商店,所以你可能不得不在这些设备上安装linux和apache + mono - 不确定这是否可行。

Sounds like a great project. 听起来像一个伟大的项目。

I would try to look at Java Applets... 我会试着看看Java Applets ......

http://java.sun.com/developer/onlineTraining/Programming/JDCBook/signed.html http://java.sun.com/developer/onlineTraining/Programming/JDCBook/signed.html

"JDK 1.1 signed applets can access local system resources if the local system is properly set up to allow it. See the JDK 1.1 Signed Applet Example page for details." “如果本地系统已正确设置为允许,则JDK 1.1签名的applet可以访问本地系统资源。有关详细信息,请参阅JDK 1.1 Signed Applet示例页面。”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM