Heroku only allows each dyno to send and receive external network traffic on a single port, which means you can't simply
run node --debug server.js
and attach your debugger to your-app.herokuapp.com:5858
.
To work around this, you can use ngrok and Heroku ngrok Buildpack to tunnel to the debugger's port and access it externally.