Skip to content

Instantly share code, notes, and snippets.

@creationix
Created May 10, 2012 17:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save creationix/06d5cd9cb9fff2b4fe49 to your computer and use it in GitHub Desktop.
Save creationix/06d5cd9cb9fff2b4fe49 to your computer and use it in GitHub Desktop.

Mobile LuvMonkey Apps

The idea is to integrate luvmonkey into b2g so that apps have a local backend that's just as robust and can share code with the remote web servers.

Lifespan of local servers

Local servers can't be running for all apps all the time because of memory constraints. A mobile phone may have 100 apps installed and that would use more ram than the phone has (at least 5-10mb each).

We could have options where an app declared it's desired lifespan (all the time, start on app launch, end on app close, etc) The user of the device would need a way to manage this as well if there were too many misbehaving apps and memory ran out.

Routing from the browser environment

The javascript in the UI side needs a way to access the local servers. This could be done with special routing at the gecko level that matches app ids to local ports.

So suppose I have an app installed from http://todos.gaiamobile.org/manifest.json, would the root of my local http server be exposed at local://todos.gaiamobile.org/ ?

Sandbox for local servers

How much do we trust these local node processes. Should we limit their permissions so that it's safe to install any app just like it's safe to browse to any website or should we give them full access and leave it up to the user to trust the apps?

Also for purposes of playing nice with other local servers, should we give each one a custom port or something so that the browser side knows how to route to it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment