I have a CF application that opens two ports. AFAIK CF can create routing on only for one of them - to the one that is located in VCAP_APP_PORT or PORT
Cloud Foundry will route TCP/WebSocket traffic coming from 80/443 to the one assigned port. Your application can not listen to any other port.
https://docs.cloudfoundry.org/devguide/deploy-apps/prepare-to-deploy.html#ports
You can either create multiple url mappings, or have two applications that communicate with each other using a messaging or database service.