简体   繁体   English

Mochahost VPS 404错误上的Java Websocket聊天

[英]Java Websocket chat on mochahost vps 404 error

I just bought a vps online and I've installed apache tomcat 8.0.20 on it. 我刚刚在网上购买了vps,并在上面安装了apache tomcat 8.0.20。 The server is up and running. 服务器已启动并正在运行。 My websocket app however that was running perfectly on localhost with apache tomcat 8.0.3 keeps giving a 但是我的websocket应用在Apache Tomcat 8.0.3上的本地主机上运行得很好,

Status 404: (Not Found) error. Status 404: (Not Found)错误。

I need help to know if there is any additional configuration I need to do. 我需要帮助,以了解是否需要做其他配置。 Or perhaps Mochahost does not support websockets. 也许Mochahost不支持websocket。 Or perhaps the Tomcat server needs to run without Apache. 也许Tomcat服务器需要在没有Apache的情况下运行。 Please I need help urgently. 请我紧急需要帮助。 I use Autobahn websocket library for android on my client side.My connection url is of the format: 我在客户端使用Android的Autobahn websocket库。我的连接URL的格式为:

ws://domain.com/AppServer/endpointvalue 

Everything works perfectly on localhost. 一切都可以在localhost上完美运行。 Though, I wonder if I need to add port numbers to the online server address, too. 但是,我想知道是否也需要在在线服务器地址上添加端口号。

It was all my fault. 都是我的错 I had to include the port number in the websocket url. 我必须在websocket网址中包含端口号。 Once I included it, it began to work as expected. 一旦包含了它,它就会按预期开始工作。 Thanks: So the path became: 谢谢:所以路径变成了:

ws://yourdomain.com:port_number/ServerAppName/endpointvalue . ws://yourdomain.com:port_number/ServerAppName/endpointvalue

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM