是否可以在Google Chrome扩展程序中嵌入HTTP服务器? [英] Is it possible to embed a HTTP server in a Google Chrome extension?

查看:772
本文介绍了是否可以在Google Chrome扩展程序中嵌入HTTP服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您认为可以在Google Chrome扩展程序中嵌入HTTP服务器吗?



我看到其他Google Chrome扩展程序执行本机代码,通过使用 NPAPI ,但我不知道是什么。它真的让我失望,因为我没有C ++专家或任何类似的。



具体来说,我想为Chrome创建一个扩展,其功能类似于Opera Unite 。对于那些不知道我在说什么的人:Opera Unite基本上是一个零-conf web服务器与浏览器捆绑在一起。



我在考虑使用像node.js 在浏览器中创建一个简单的Web界面来控制浏览器中的一些东西。将其视为浏览器的遥控器。如果node.js不可能,我想使用 lighthttpd 或类似的东西。



但是,如何使用现有的网络服务器并使NPAPI插件脱离

我希望任何浏览器都能与我的扩展程序通信。特别是我想要移动设备,如Android或iPhone能够远程控制浏览器。除了使用HTTP服务器之外,还有其他方法可以实现这一点吗?



另一个更新:我认为最简单的方法是请使用网络上的中继服务器,例如 Pusher 或某些自助服务。但我不喜欢这种方法,因为它需要不断的互联网访问,因为它是一个付费服务。



谢谢大家!

解决方案

以下是有关在Chrome应用中制作网络服务器的信息:
https://developers.google.com/live/shows/7320022-5001


Do you think it would be possible to embed a HTTP server inside a Google Chrome extension?

I've seen other Google Chrome extensions execute native code and apparrently they do it by using NPAPI, but I have no idea what that is. And it's really freaking me out, as I'm no C++ expert or anything like that. So I feel a little stuck now and that's why I'm asking for help.

Specifically, I want to create an extension for Chrome with features similar to Opera Unite. For those who don't know what I'm talking about: Opera Unite is basically a zero-conf web server bundled with the browser. I don't want to use it for the same things Opera does, but I like the concept.

I was thinking about using something like node.js inside the browser to create a simple web interface to control some stuff in the browser. Think of it as a remote control for the browser. If node.js isn't possible I'd like to use lighthttpd or something similar. The technology really doesn't matter as long as it allows me to receive commands over HTTP.

But how do I take an existing web server and make a NPAPI plugin out of it?

Clarification: I'd like any browser to be able to communicate with my extension. Especially I want mobile devices like Android or the iPhone to be able to remote control the browser. Is there any other way to accomplish that except with a HTTP server?

Another update: I think the easiest way to do this would be to use a relay server on the web like Pusher or some self-created service. But I don't like this approach because it requires constant internet access and because it's a paid service.

Thank you all!

解决方案

Here is info on making a web-server in a Chrome app: https://developers.google.com/live/shows/7320022-5001

这篇关于是否可以在Google Chrome扩展程序中嵌入HTTP服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆