How to allow a restricted port in Firefox

By default Firefox complains about access to non-standard ports and blocks access. You can override this behaviour by following these instructions. Basically add the comma separated list of allowed ports to the network.security.ports.banned.override string via about:config.