Linux: GUI browsers do not honor '/etc/services' service names

1

I'd like to avoid remembering common port names: e.g. for my CUPS it's http://localhost:631/.

I know that there're service names (named aliases for ports) in '/etc/services':

$ cat /etc/services | grep ipp
ipp             631/tcp     # Internet Printing Protocol
ipp             631/udp

And this works just fine:

$ lynx http://localhost:ipp/

However, accessng http://localhost:ipp/ does not work in Firefox, Opera, Konqueror.

Any ideas?

kolypto

Posted 2009-09-22T14:00:51.407

Reputation: 2 861

Use the port number... – EmmEff – 2009-09-22T14:05:16.877

You seem to know nothing about laziness ;) Anyway, if there's such a feature - it should work! :) – kolypto – 2009-09-22T14:14:04.477

The GUI tends to be segregated from the CLI apps (and configurations). For example, you might setup a SOCKS tunnel in the GUI, but no command line apps know about it. – Jeremy L – 2009-09-22T14:47:40.457

1No, that's not the case. Browsers should just use getportbyname() for [a-z]* ports – kolypto – 2009-09-22T15:23:41.193

Answers

4

Be glad that the browser authors are sticking to the RFC (1738). Chaos ensues when software makers don't follow RFCs, as those documents set the pace for standards on the Internet.

Using the port number instead of a service name is cross platform, as not all systems have consistent contents for /etc/services, or an equivalent.

Specifically in this case, section 3.1 of the RFC states:

3.1. Common Internet Scheme Syntax

While the syntax for the rest of the URL may vary depending on the
particular scheme selected, URL schemes that involve the direct use
of an IP-based protocol to a specified host on the Internet use a common syntax for the scheme-specific data:

    //<user>:<password>@<host>:<port>/<url-path>

...

port
    The port number to connect to. Most schemes designate
    protocols that have a default port number. Another port number
    may optionally be supplied, in decimal, separated from the
    host by a colon. If the port is omitted, the colon is as well.

jtimberman

Posted 2009-09-22T14:00:51.407

Reputation: 20 109

1You're absolutely right. The only thing that confused me that lynx was able to handle the URL correctly. Thanks anyway :) – kolypto – 2009-09-22T18:45:41.457

5

File a bug. Wait, someone did and it was rejected because it contradicts RFC 1738. So I guess you'll have to convince Mozilla (or Opera or KDE) to change their mind.

TRS-80

Posted 2009-09-22T14:00:51.407

Reputation: 2 923

1Or write an updated RFC and convince the 'net to accept it and THEN convince the browser teams to update their software. :-) – Doug Harris – 2009-09-22T17:46:43.633

Or, if you use Firefox (or, well, anything other than Opera) write your own extension. – user1686 – 2009-09-23T16:30:53.573