私は古くからHerokuを使用していないので、ちょっと錆びます。 ラチェットIOServerを実行する小さなPHPアプリケーションを作成しました。ポート5000でリッスンします。heroku local
を実行してtelnet localhost 5000
と接続すると、すべて動作するようです。私はPHPプロセスを実行して接続を受け付けるいくつかの方法を試しました。WebSocketはローカルではありませんが、Heroku上では動作しません - PHPアプリケーション
私のProcfileは次のようになります。
web: php bin/console bot:start
私はそれが動作しませんHerokuのにサーバーを展開するときheroku local
Downloading forego-0.16.1 to /Users/roje/.heroku... done
forego | starting web.1 on port 8080
web.1 | It works!
web.1 | New connection! (97)
web.1 | Connection 97 sending message "sdfdfs"
実行。 は、私はポート5000
上のボックスにtelnetで接続しようとすると、私は
telnet myapplication.herokuapp.com 5000
Trying 46.137.127.234...
telnet: connect to address 46.137.127.234: Connection refused
telnet: Unable to connect to remote host
を取得したログは、もう少し情報が表示されます。
2016-03-19T16:08:27.258081+00:00 heroku[web.1]: State changed from crashed to starting
2016-03-19T16:08:29.754688+00:00 heroku[web.1]: Starting process with command `php bin/console bot:start`
2016-03-19T16:08:31.659074+00:00 app[web.1]: It works!
2016-03-19T16:09:29.999903+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2016-03-19T16:09:29.999903+00:00 heroku[web.1]: Stopping process with SIGKILL
2016-03-19T16:09:30.638659+00:00 heroku[web.1]: Process exited with status 137
2016-03-19T16:09:30.660710+00:00 heroku[web.1]: State changed from starting to crashed
2016-03-19T16:18:51.610894+00:00 heroku[web.1]: State changed from crashed to starting
2016-03-19T16:18:55.208396+00:00 heroku[web.1]: Starting process with command `php bin/console bot:start`
2016-03-19T16:18:56.648708+00:00 app[web.1]: It works!
2016-03-19T16:19:55.569256+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2016-03-19T16:19:55.569256+00:00 heroku[web.1]: Stopping process with SIGKILL
2016-03-19T16:19:56.252235+00:00 heroku[web.1]: Process exited with status 137
2016-03-19T16:19:56.264205+00:00 heroku[web.1]: State changed from starting to crashed
お勧めはありますか?私は動的ポートHeroku + node.js error (Web process failed to bind to $PORT within 60 seconds of launch)
を割り当てるHerokuの約一部を読み取る
EDIT#1
私の代わりに、そのポートをリッスンしようとしたが、私はまだを介して接続傾けます。 telnet。面白いログがありますが。多分あなたの何人かがIPアドレスを試していますか?
2016-03-19T16:38:35.577130+00:00 app[web.1]: It works!
2016-03-19T16:38:35.827466+00:00 app[web.1]: New connection! (97)
2016-03-19T16:38:35.827531+00:00 app[web.1]: Connection 97 has disconnected
2016-03-19T16:38:35.832097+00:00 app[web.1]: New connection! (107)
2016-03-19T16:38:35.832160+00:00 app[web.1]: Connection 107 has disconnected
2016-03-19T16:38:49.891455+00:00 app[web.1]: New connection! (108)
2016-03-19T16:38:49.891506+00:00 app[web.1]: Connection 108 has disconnected
2016-03-19T16:40:54.694321+00:00 app[web.1]: New connection! (109)
2016-03-19T16:40:54.694368+00:00 app[web.1]: Connection 109 has disconnected
私はまだ同じエラーが発生します。
Trying 176.34.255.126...
telnet: connect to address 176.34.255.126: Connection refused
telnet: Unable to connect to remote host
私は、Herokuが外部から80または443以外のものに接続できるとは思いません。 http://stackoverflow.com/questions/8107748/can-a-heroku-app-use-different-multiple-portsを参照してください。ポート5000はインスタンス内にありますが、Herokuのルータは外部にルーティングしません。 – ceejayoz
環境変数でHerokuが動的に定義したポートでIOServerを起動しようとしました。この場合、ポートは '40220 'として割り当てられました。まだ運がない。 –