Heroku- Web process failed to bind to $PORT within 90 seconds of launch. TooTallNate Websockets
Heroku wants you to use a certain port.
Add this to your Procfile to get that port:
-Dserver.port=$PORT
So yours would look like this: Procfile
web: java $JAVA_OPTS -Dserver.port=$PORT -cp target/classes/:target/dependency
Try using this:
String host = "0.0.0.0";
int port = System.getenv("PORT");
On Heroku, you must bind to 0.0.0.0
and use the port assigned to your app, which is contained in the $PORT
environment variable.
From the client, you will not need to specify a port, so only wss://Heroku-Name-39329.herokuapp.com/
should be used (not the one with 5000).