Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

set or get the Port used by FlyWeb programmatically?

26 views
Skip to first unread message

Martin Dudel

unread,
Nov 28, 2016, 11:38:43 AM11/28/16
to mozilla-d...@lists.mozilla.org
Is it possible to set or get the port the FlyWeb server listens on programmatically in Javascript from the server object?

Something along the lines of:
navigator.publishServer("ServerName",{'uiUrl':'myContext','port':654321}).then(function(server){
}
);

navigator.publishServer('Hello FlyWeb',{'port':654321}).then(function(server) {
server.onfetch = function(event) {
var port = server.port;
var html = '<h1>Hello FlyWeb!</h1>' +
'<h3>You requested: ' + event.request.url + '</h3><br>'+
'on port:'+port;

event.respondWith(new Response(html, {
headers: { 'Content-Type': 'text/html' }
}));
};
});

Kannan Vijayan

unread,
Nov 28, 2016, 11:56:01 AM11/28/16
to Martin Dudel, mozilla-d...@lists.mozilla.org
Hi Martin,

No.  The design of the API is such that you should not have access to this information.  Largely for abstraction reasons.  Ultimately, "publishServer" is an abstract operation, and the fact that it operates over TCP sockets and mDNS service advertisement is an implementation detail.

We hope eventually to be able to implement Bluetooth and other future transport backends (e.g. WiFi-Direct, LTE-Direct, etc.).  The concept of ports doesn't translate across all of these mediums.  The idea is that the browser API is the layer of abstraction for those differences.

Cheers.
Kannan


_______________________________________________
dev-flyweb mailing list
dev-f...@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-flyweb

Martin Dudel

unread,
Nov 30, 2016, 8:12:20 AM11/30/16
to mozilla-d...@lists.mozilla.org
We have a use-case where an HTTP(S) server in the browser would really help us out.
We have a web app that aggregates geospatial data and applies it to a web map. Some of our users would like this in Google Earth, ArcGIS Earth, etc. which are applications that run outside of the web browser.

Our intent is to allow the browser to aggregate and filter the data and then expose the result to the geospatial applications via a KML network link. The network link requires a URL to the data source. FlyWeb actually works great, however we have to send a request to FlyWeb, extract the port from the request header, and then build the URL to the resource. We would love to do this in Javascript,

My coworker can add the properties we need to the server object but we can't seem to run the XPI he created since it is not signed. when he returns I will ask for more details of what he has done.

In the meantime, is there a means to request that these properties (like the server port) be added to the server object?
0 new messages