If you are running Slideshow on non-rooted device, you might wonder why you have to enter also port number 8080 in the URL to access the web interface. This post explains the technical background behind port numbers used by Slideshow for web and FTP interface.

What are network ports?

On regular server, there are usually multiple network services available, for example web, FTP, SSH etc. If client (in case of web: browser) wants to connect to the server, it needs to tell server to which service it wants to connect. That’s when network port comes to play. Each service is assigned a port number between 0 to 65535, on which it “listens” for connections from clients. Client then connects to the combination of IP address and port number and operating system on server send the connection to the application listening on that port.

For common network protocols, there are usually default port numbers, which has been standardized. For example for HTTP protocol, default port number is 80, for HTTPS is 443 and for FTP is 21. So if you type address http://www.google.com into your browser, it automatically checks that you omitted network port, so your browser will access server www.google.com on port number 80. If you type address http://192.168.1.1:8080, browser finds that you entered port 8080 and will access server 192.168.1.1 on port 8080.

Description of parts of URL address

You can find more information about how network ports work for example on https://en.wikipedia.org/wiki/Port_(computer_networking) or https://www.tutorialspoint.com/what-is-network-port.

Restricted ports on Linux and Android

On Linux operating system, port numbers 0 to 1023 are called restricted. Under normal circumstances, only administrator (also called root) can start an application which will be listening on any of these ports. The reason for this is that many of the port numbers in range 0 to 1023 are commonly used as default ports for various protocols. It would be insecure if regular user (non-administrator) could start an application listening on port 80 (HTTP port) and block the actual HTTP server.

As Android operating system is based on Linux (actually modified version of Linux kernel), it inherits this restriction. On non-rooted devices, only system application can listen on restricted ports 0-1023.

Slideshow access to restricted ports

On non-rooted devices, Slideshow starts web interface on port 8080 and FTP interface on port 8021. You can change these port numbers, but it is not possible to change them bellow 1024 due to security restrictions mentioned above.

On rooted devices, Slideshow can listen on ports bellow 1024 using root access, but only indirectly. That means that the web interface is still actually listening on port 8080 and using root access, Slideshow asks Android for local redirection from port 80 to port 8080. That means if your browser connects to port 80 on the device, Android will internally redirect it to port 8080 for Slideshow. Similar redirection is made for HTTPS (443 -> 8443) and FTP (21 -> 8021).

On application start, Slideshow automatically detects whether the device is rooted or not. If you open Help in on-screen menu, you will always see the correct (working) address for web and FTP interface.