DasBoot
DasBoot

Reputation: 707

embedded http server in c++ for chrome extension native client

i was trying to find some examples that would give me some pointers on how to create an http server within a chrome extension, but haven't had any luck. does anyone know a how to start an NPAPI,NACL http server? Thanks

Upvotes: 0

Views: 569

Answers (1)

Egor Pasko
Egor Pasko

Reputation: 516

Short answer: not possible.

If you want to open a port on a local machine to allow connections, then that is not allowed by the web security model. NaCl runs with the same privileges as JavaScript, no extra holes. However, you may specify extra flags to chrome on start to get more permissions from NaCl, such as open debug port, or get access to raw network sockets.

If you want to 'emulate' an HTTP server to make your extension keep using it regardless of being offline, then it is easier to use the PostMessage API.

Upvotes: 3

Related Questions