javascript 在 Chrome 扩展程序中连接 OpenVPN?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21174645/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Connect OpenVPN in Chrome extension?
提问by Kirzilla
Is it possible to connect openVPN programmatically from the Chrome extension API? All I've found in Chrome extensions API docs are chrome.proxy
and chrome.socket
.
是否可以从 Chrome 扩展 API 以编程方式连接 openVPN?我在 Chrome 扩展 API 文档中发现的所有内容都是chrome.proxy
和chrome.socket
.
I belive it is possible to run external program using NPAPI
and this extenral program will create nessesary openVPN connection.
我相信可以使用运行外部程序NPAPI
并且这个外部程序将创建必要的 openVPN 连接。
UPD:It seems that OpenVPN have TCP/Socket management interface ( see http://openvpn.net/index.php/open-source/documentation/miscellaneous/79-management-interface.html) So it is rather easy to connect it from Chrome extension programmatically.
UPD:OpenVPN 好像有 TCP/Socket 管理接口(见http://openvpn.net/index.php/open-source/documentation/miscellaneous/79-management-interface.html)所以连接起来还是比较容易的以编程方式从 Chrome 扩展程序。
采纳答案by Brad
@vcsjones is correct... the proper way would be with NPAPI or a protocol handler. However, there is another method.
@vcsjones 是正确的......正确的方法是使用 NPAPI 或协议处理程序。但是,还有另一种方法。
In the past, when I have needed to execute native code with a browser extension, I embed a small HTTP server into a native application that can be called from the browser extension. This allows me to write whatever I need to, while the browser extension is nothing but a control for that native application. You could then easily write something to control OpenVPN.
过去,当我需要使用浏览器扩展执行本机代码时,我会将一个小型 HTTP 服务器嵌入到一个可以从浏览器扩展中调用的本机应用程序中。这使我可以编写我需要的任何内容,而浏览器扩展程序只是该本机应用程序的控件。然后,您可以轻松编写一些内容来控制 OpenVPN。