protected String getScheme(String requestScheme, int port) {
        if (port == DEFAULT_HTTP_PORT) {
            return HTTP_SCHEME;
        } else if (port == SslFilter.DEFAULT_HTTPS_PORT) {
            return SslFilter.HTTPS_SCHEME;
        } else {
            return requestScheme;
        }
    }
A Filter that requires the request to be on a specific port, and if not, redirects to the same URL on that port.
<p/>
Example config:
<pre>
[filters]
port.port = 80
<p/>
[urls]
/some/path/** = port
# override for just this path:
/another/path/** = port[8080]
</pre>

@since 1.0
web/src/main/java/org/apache/shiro/web/filter/authz/PortFilter.java