floatinghotpot / cordova-httpd

Embed tiny web server into Cordova with a plugin
284 stars 149 forks source link

Feature if possible #14

Open eralha opened 9 years ago

eralha commented 9 years ago

Hi, i know that this plugin is working as intended, is there any change you can implement to make this work like a network comunication pipe? for exp: you type in the remote browser http://ip.off.device:8080/some/route/ and have on the app a listener for requests on the started server:

var httpd = ( cordova && cordova.plugins && cordova.plugins.CorHttpd ) ? cordova.plugins.CorHttpd : null;

httpd.on('request', function(uri){
  console.log(uri);// /some/route/
});

My intention is to have an application running on a device and remotely (on the same network) do some actions via browser for exp serve some html, js, css files, when the user clicks some button it makes a new request that will be handled by the server. This plugin is the closest i found to what i want using phonegap, i could achieve this using some RTC framework like firebase, but i think that having a local network server will be faster.

vallieres commented 9 years ago

Did you manage to have it working with some kind of "endpoint" that triggers some JavaScript code?

eralha commented 9 years ago

Hi, im using fire base with websocket i wanted some network socket, i got it worked with firebase, despite the fact that it is webbased, it could be faster if it was local network based.

vallieres commented 9 years ago

And you can communicate between two devices with fire base and websocket? Do you have an example?

eralha commented 9 years ago

You can get an idea using this app example from firebase https://github.com/firebase/firechat it have a learning curve.