Heroku Web进程无法在启动后的90秒内绑定到$ PORT。 TooTallNate Websockets [英] Heroku- Web process failed to bind to $PORT within 90 seconds of launch. TooTallNate Websockets

查看:322
本文介绍了Heroku Web进程无法在启动后的90秒内绑定到$ PORT。 TooTallNate Websockets的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我如何在heroku上连接到我的服务器?

b

当我的网站试图在 $ b

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

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

我的heroku日志输出。

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

然后(仍然是Heroku日志)

 错误R10(引导超时) - > Web进程无法在启动后的90秒内绑定到$ PORT 
用SIGKILL停止进程
进程退出状态137
状态从开始崩溃到
状态从崩溃更改为启动
使用命令`java $ JAVA_OPTS -cp target / classes /:target / dependency / * v1.a1.server

$ b $启动进程b

我的JavaScript日志

 与'wss://Heroku-Name-39329.herokuapp的WebSocket连接.com /:5000 /'失败:通过代理服务器建立隧道失败。 

在服务器中设置的我的应用程序。

  String host =; 
int port = 5000;

我的程序文件

  web:java $ JAVA_OPTS -cp target / classes /:target / dependency / * v1.a1.server 


<使用这个:

  String host =0.0解析方法

0.0\" ;
int port = System.getenv(PORT);

在Heroku上,您必须绑定到 0.0.0.0 并使用分配给您的应用的端口,该端口包含在 $ PORT 环境变量中。



从客户端,你不需要指定一个端口,所以只能使用 wss://Heroku-Name-39329.herokuapp.com/ (而不是5000 )。


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

解决方案

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).

这篇关于Heroku Web进程无法在启动后的90秒内绑定到$ PORT。 TooTallNate Websockets的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆