Yes. You can transmit HTML over any medium that can transmit text. Email, for example. I'm willing to bet that at least 90% of all emails you receive, and probably also most that you write, are HTML. You can also view HTML files on your local filesystem.
The browser doesn't care at all how the HTML arrived on your system. That's "someone else's problem".
Let's say that a server hosts a webpage on port 20 (that is: FTP port). If I connected to the server with: ftp://<hostname>/<path_to_webpage>
, would I be able to display it as expected?
Yes, provided the server is actually running an FTP server on port 20.
Yet more interestingly, in the same scenario, if I connected to the server with: http://<hostname>:20/<path_to_webpage>
, would it work in this scenario as well?
No, of course not. We are assuming that the server is running an FTP server on port 20, not an HTTP server, so obviously you can't talk HTTP to it.
If there's an FTP server listening on port 20, then the first one will work. Since there is an FTP server listening on port 20, there cannot be an HTTP server listening on port 20, so the second one will not work.
If there's an HTTP server listening on port 20, then the second one will work. Since there is an HTTP server listening on port 20, there cannot be an FTP server listening on port 20, so the first one will not work.
If there's neither an FTP nor an HTTP server listening on port 20, neither of the two will work.
None of this has anything to do with HTML. The HTTP or FTP client doesn't care what it is downloading. The HTML renderer doesn't care where the HTML came from.
ftp://speedtest.tele2.net
, your browser uses the FTP protocol to list the files and generates a HTML page to display this list to you.ftp://speedtest.tele2.net:21
works exactly the same. It is not possible to mix the HTTP and FTP protocols. Your second scenario won't work, though your browser may be able to determine that the remote server uses ftp and thus uses ftp to communicate further. Chrome however tells meERR_UNSAFE_PORT
when I try to connect to speedtest.tele2.net:21