我们在 http://ourapp.com
上有一个 Java web 应用程序托管在 Heroku 上,应用程序的前端无法连接到正在运行的 WebSocket 端点 (endpoint
)在 Heroku dyno 中。我们已经尝试了这些 URI:
ws://ourapp.com/endpoint
ws://ourapp.com:80/endpoint
ws://ourapp.com:8080/endpoint
ws://ourapp.com:8084/endpoint
ws://ourapp.com:443/endpoint
wss://ourapp.com/endpoint
wss://ourapp.com:80/endpoint
wss://ourapp.com:8080/endpoint
wss://ourapp.com:8084/endpoint
wss://ourapp.com:443/endpoint
以上都没有打开连接。我们在这里缺少什么?
PS:我已经搭建了一个试验场:http://vakuutustiedot-dev.herokuapp.com/websocket.test.html (URI 是 PROTOCOL:vakuutustiedot-dev.herokuapp.com:PORT/trial
)
目标应用程序在 Heroku Apache Tomcat 8.5.38 中运行。 端口号是怎么回事,不知道怎么弄。
最佳答案
也许您没有像这个答案 ( https://stackoverflow.com/a/50002416/11197115 ) 那样为 Heroku 添加对 WebSockets 的支持?
关于java - 用于连接到 Heroku WebSocket 端点的 URI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59235294/