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

后端 未结 3 694
被撕碎了的回忆
被撕碎了的回忆 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:37

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

    0 讨论(0)
  • 2020-12-05 16:40

    Here is another web server implemented with chrome.socket: https://github.com/kzahel/web-server-chrome. The server example linked to in chrome-app-samples is actually really buggy and will lock up if you e.g. hold down Ctrl-R on a page served by it.

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题