public boolean handleIQ(IQ packet) throws UnauthorizedException {
        Element childElement = packet.getChildElement();
        String namespace = null;

        // ignore errors
        if (packet.getType() == IQ.Type.error) {
            return true;
        }
        if (childElement != null) {
            namespace = childElement.getNamespaceURI();
        }

        if ("http://jabber.org/protocol/disco#info".equals(namespace)) {
            IQ reply = XMPPServer.getInstance().getIQDiscoInfoHandler().handleIQ(packet);
            router.route(reply);
            return true;
        }
        else if ("http://jabber.org/protocol/disco#items".equals(namespace)) {
            // a component
            IQ reply = XMPPServer.getInstance().getIQDiscoItemsHandler().handleIQ(packet);
            router.route(reply);
            return true;
        }
        else if (FileTransferManager.NAMESPACE_BYTESTREAMS.equals(namespace)) {
            if (packet.getType() == IQ.Type.get) {
                IQ reply = IQ.createResultIQ(packet);
                Element newChild = reply.setChildElement("query", FileTransferManager.NAMESPACE_BYTESTREAMS);

                final String externalIP = JiveGlobals.getProperty( PROPERTY_EXTERNALIP );
                if ( externalIP != null && !externalIP.isEmpty() )
                {
                    // OF-512: Override the automatic detection with a specific address (useful for NATs, proxies, etc)
                    final Element response = newChild.addElement( "streamhost" );
                    response.addAttribute( "jid", getServiceDomain() );
                    response.addAttribute( "host", externalIP );
                    response.addAttribute( "port", String.valueOf( connectionManager.getProxyPort() ) );
                }
                else
                {
                    // Report all network addresses that we know that we're servicing.
                    for ( final InetAddress address : getAddresses() )
                    {
                        final Element response = newChild.addElement( "streamhost" );
                        response.addAttribute( "jid", getServiceDomain() );
                        response.addAttribute( "host", address.getHostAddress() );
                        response.addAttribute( "port", String.valueOf( connectionManager.getProxyPort() ) );
                    }
                }
                router.route(reply);
                return true;
            }
            else if (packet.getType() == IQ.Type.set) {
                String sid = childElement.attributeValue("sid");
                JID from = packet.getFrom();
                JID to = new JID(childElement.elementTextTrim("activate"));

                IQ reply = IQ.createResultIQ(packet);
                try {
                    connectionManager.activate(from, to, sid);
                }
                catch (IllegalArgumentException ie) {
                    Log.error("Error activating connection", ie);
                    reply.setType(IQ.Type.error);
                    reply.setError(new PacketError(PacketError.Condition.not_allowed));
                }

                router.route(reply);
                return true;
            }
        }
        return false;
    }
The default port of the file transfer proxy
xmppserver/src/main/java/org/jivesoftware/openfire/filetransfer/proxy/FileTransferProxy.java