成人在线亚洲_国产日韩视频一区二区三区_久久久国产精品_99国内精品久久久久久久

您的位置:首頁技術(shù)文章
文章詳情頁

在啟動后的90秒內(nèi),Heroku- Web進(jìn)程未能綁定到$ PORT。TooTallNate Websockets

瀏覽:112日期:2024-05-02 08:58:50
如何解決在啟動后的90秒內(nèi),Heroku- Web進(jìn)程未能綁定到$ PORT。TooTallNate Websockets?

嘗試使用此:

String host = '0.0.0.0';int port = System.getenv('PORT');

在Heroku上,您必須綁定0.0.0.0并使用分配給應(yīng)用程序的端口,該端口包含在$PORT環(huán)境變量中。

從客戶端,您無需指定端口,因此僅wss://Heroku-Name-39329.herokuapp.com/應(yīng)使用(而不是具有5000 的端口)。

解決方法

我正在使用tootallnate websockets服務(wù)器來偵聽來自網(wǎng)站的連接。

如何連接到Heroku上的服務(wù)器?

當(dāng)我的網(wǎng)站嘗試連接時

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

要么

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

我的heroku日志輸出。

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=

然后(仍然是Heroku Logs)

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

我的JavaScript日志

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

我的應(yīng)用程序在服務(wù)器內(nèi)設(shè)置。

String host = '';int port = 5000;

我的檔案

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

標(biāo)簽: web