Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
722 views
in Technique[技术] by (71.8m points)

java - Heroku- Web process failed to bind to $PORT within 90 seconds of launch. TooTallNate Websockets

I'm using a tootallnate websockets server listening for connections from a website.

How do I make a connection to my server on heroku?

When my website tries to connect at

wss://Heroku-Name-39329.herokuapp.com/

or

wss://Heroku-Name-39329.herokuapp.com:5000/

My heroku logs output.

at=error code=H10 desc="App crashed" method=GET path="/" host=wss://Heroku-Name-39329.herokuapp.com request_id=4afca002-2078-439c-85dc-ad6ef7db50d2 fwd="207.244.77.23" dyno= connect= service= status=503 bytes=

And then(Still Heroku Logs)

Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 90 seconds of launch
Stopping process with SIGKILL
Process exited with status 137
State changed from starting to crashed
State changed from crashed to starting
Starting process with command `java $JAVA_OPTS -cp target/classes/:target/dependency/* v1.a1.server

My javascript logs

WebSocket connection to 'wss://Heroku-Name-39329.herokuapp.com/:5000/' failed: Establishing a tunnel via proxy server failed.

My Apps set within the server are.

String host = "";
int port = 5000;

My Procfile

web: java $JAVA_OPTS -cp target/classes/:target/dependency/* v1.a1.server
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...