从网页调用COM端口
我正在寻找一种从网页调用 COM 端口的方法。
我正在考虑运行一个 Java WebStart(或 Flash?)程序,该程序打开一个本地 Web 服务器,允许使用 JSONP 与 COM 端口进行交互。
是否有任何节目以我不知道的方式阻止安全限制?这应该是可能的:
- 使用 Java WS 应用程序中的本机库(Java COM 桥)
- 打开本地端口
- 从 javascript 访问本地端口,可能使用
标签
- 完成所有这些操作,而不会用“This”吓唬用户网站正在尝试做一些非常令人讨厌的事情,请尽快下车”之类的消息:)
我以前使用过 Java COM 桥,所以这不应该是问题 - 至少在我能够的情况下运行本机代码。
那么我的 JNLP 文件必须是什么样子才能使其正常工作? Java WS 有替代方案吗?最好将其安装为守护进程?
I'm looking for a way to call a COM port from a webpage.
I was thinking abut running a Java WebStart (or Flash?) program that opens a local web server that allows to interact with the COM port using JSONP.
Are there any show stopping security restrictions on the way that I don't know of? This should be possible:
- use native libraries (Java COM bridge) from Java WS application
- open a local port
- access local port from javascript, likely using
<script>
tags - do all this without scaring users with "This website is trying to do something really nasty, get off as fast as you can" kind of messages :)
I've used a Java COM bridge before, so this shouldn't be the problem - at least as soon as I'm able to run native code.
So how would my JNLP file have to look like to get this working? Any alternatives to Java WS? Better install it as a daemon?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不可能的。这违反了各种非常基本的安全原则,尤其是关于
做这一切而不用“这个网站正在尝试做一些非常令人讨厌的事情,尽快离开”之类的消息来吓唬用户的部分
这正是这些消息想要防止的。
Impossible. This violates all sorts of very basic security principles, especially the part about
do all this without scaring users with "This website is trying to do something really nasty, get off as fast as you can" kind of messages
This is EXACTLY what those messages are intended to prevent.
本文回答了我的问题的第一部分,即 WS 到 COM 方法,即: 使用 DLL、WebStart 和 Maven
在本地端口上访问 HTTP 服务器也应该是可行的,因为这就是 Playdar 例如。
This article answers the first part of my question, the WS to COM approach that is: Juggling with DLLs, WebStart and Maven
Accessing an HTTP server on a local port should also be feasible as that's what Playdar does for instance.
你想达到什么目的?
您需要一个独立的软件来完成这项工作。用户必须安装它。就像安全通道一样。
What are you trying to achieve?
You need a standalone software that does the job. The user will have to install it. Like the security pathches.