eXport-it, android  UPnP Client/Server

eXport-it android UPnP/HTTP Client/Server

Android


an Android wireless file sharing application for video, audio, images and ebooks




Server



Starting the server

On the title line, you have on the left the server name and the URL to access this server. Using it with a Web browser, give the default home page which is just a table with all files exported by the server. On the right side of the title line, is the external URL to use if you are connected to Internet by an ADSL router supporting "port aliasing". Initially the external port alias is set to zero, and you are not accessible through an Internet Gateway. If you change this value to a number between 1024 and 65535, the server will try to set it up by UPnP with a lease time of 24 hours . I am not sure it will work with all Internet Gateways. Don't hesitate to report problems (by e-mail) documented with the XML presentation text of your Internet Gateway. You can configure your router manually as explained below, if UPnP doesn't work.


upnp media server

When you start eXport-it server application, it starts automatically a “long running” UPnP service including the media and HTTP servers. This service gives a small icon on the Android desktop when running.

By default, all your video, audio, image and eBook files are exported.

The default server name is “eXport-it“, but if you have more than one server on a Wifi network, it looks better to modify at least one name.

upnp media server

Clicking on configure button:

http server

With the configuration dialog window, you can change the font size by default to adapt it depending on your screen density and dimension: 1 is for 8sp character size, 2 for 10sp, … till 6 for 18sp. “0″ is undefined (it should give 10sp). This text size is used for all eXport-it windows including the help.

You have also the choice to change the default language, but it is not totally dynamic, you must save the config and go back to the server main window to set the change effective.

It looks better to set a real server name than to keep the default. You can also adapt the port numbers to what you want, the media server port can be “0″ (ephemeral) but I prefer to define one for debugging purpose. The alias depends on your ADSL router configuration and if you want to publish your files on the public Internet or not.

In the background (long running service)

When the server is started, it runs in the background as an Android service, showing a notification icon on the android status bar. This service contains different programs: the media server with its UPnP Directory Content Server and a small UPnP Connection Manager, and the HTTP server. Both are required up and running to provide the service to clients.

The HTTP server defines at startup an initial “home page” which just a list (a table) of the files exported by this server, the first column permits to play (HTTP get) the file, the second (HTTP post in binary mode) to download it, the third column gives in text mode, the URL of the file (for copy/past it when preparing your own HTML page). In addition, the HTTP server has a very simple OPDS catalog for the local eBooks (this catalog is just a list of the selected files, there is no summary of the book or information of the author)…

For controlling the server, you can use the eXport-it client or a Web browser pointing it to the URL as given in the first page of the “server” window, something like //192.168.1.47:8192. For checking the OPDS catalog, you must use the same URL but with “/opds” (//192.168.1.47:8192/opds), or from Internet the “external” URL if your ADSL router is configured for “port aliasing”.

upnp media server

Configuring port forwarding

This parameter is only for people using a Wifi network with an Internet gateway. This configuration can be totally dynamic if the gateway supports UPnP standards, in this case you have just to specify an external alias port number in the configuration, and the router is automatically configured with a lease time of at least 24 hours.

An Internet gateway has at least one external IP address and one on the Wifi network and perhaps still one or more on ethernet. The configuration of port forwarding on a router is dynamic and does not cut the service. You have just to add an alias in a table. Each application uses at least one port number (less than 65535). If the port number you wanted is already defined you have just to use another.

This server like all HTTP servers, uses TCP protocol. The default port numbers used by this HTTP server are 8192 for HTTP but you can modify these numbers in the configuration. If you set the HTTPS port as zero, this protocol is disabled.

On my router, I defined with name "HTTP2" an external port number of 8080 to forward to 192.168.1.47 (the IP address of my Android tablet on the Wifi network) with port 8192, and with name "exportit" the port 4343 to forward to 192.168.1.47 and port 8193.

configuring port forwarding

When I want that the eXportit server to be accessible from Internet, I have to configure the "External port number" in the configuration, to be 4343. This permits to configure automatically an external HTML Page with the external IP address and this alias port number 4343.

To disable remote use of your web page, you have just to reconfigure the server with an "external port number" of zero and the HTML page will be configured with a wrong port number and not usable. In fact all requests sent externally to 4343 are forwarded to the HTTPS server on port 8193, but the server will send back the login page with URLs pointing to port 8193 which is NOT accessible on Internet. You can see these requests in your HTTP log on the eXport-it server window. In addition, your external IP address is, in most of the cases, changed every day.

If you want to use the simple HTTP over Internet to get better performances than with HTTPS but without security, you have just to set the HTTPS port to zero, and the "external port number" to be 8080. You avoid to configure the router very often with such a configuration.


Easily trying your port forwarding configuration

You can test this setting from your Wifi network using a public Web proxy with javascript support like www.faceofliberty.com, to connect to your external URL with your external IP address and port alias...

You can by this way, test the login and check all the pages, unfortunately it is not possible to listen to music, or to look at series of images. Only direct clicks on files are usable due to Web proxy environment.

configuring port forwarding