Is it possible to embed a HTTP server in a Google Chrome extension?

后端 未结 3 741
被撕碎了的回忆
被撕碎了的回忆 2020-12-05 16:13

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 apparren

3条回答
  •  广开言路
    2020-12-05 16:41

    If you want to do a remote control for the browser, would something like HTML5 WebSockets work for you?

    http://www.html5rocks.com/tutorials/websockets/basics/

    You can have an external "remote" server that your extension listens to via WebSockets. If you want to host a webserver via extensions. You would need to use NPAPI, there are many C++ libraries out there (Google search) that can do a simple webserver. But I would rather use WebSockets communicate to an external server which will provide you anything you want.

    But if you insist, you would need to learn C++, NPAPI, there are many examples online regarding NPAPI.

提交回复
热议问题