Port and path encoding. Relates to #1.