admin管理员组文章数量:1375833
I am using websocket in my app and everything worked fine when i was using localhost. The problem starts when i changed localhost to my server ip address then i got this error: Error during WebSocket handshake: Unexpected response code: 404
This is my httpd.conf
...
Listen 25.48.63.220:80
Listen 25.48.63.220:8081
...
ServerName 25.48.63.220:80
...
I think that i am able to connect with my server because when i typed wrong ip address i don't get this error.
What else i have to to change ?
I am using websocket in my app and everything worked fine when i was using localhost. The problem starts when i changed localhost to my server ip address then i got this error: Error during WebSocket handshake: Unexpected response code: 404
This is my httpd.conf
...
Listen 25.48.63.220:80
Listen 25.48.63.220:8081
...
ServerName 25.48.63.220:80
...
I think that i am able to connect with my server because when i typed wrong ip address i don't get this error.
What else i have to to change ?
Share Improve this question edited May 13, 2019 at 7:07 Towkir 4,0142 gold badges26 silver badges42 bronze badges asked Apr 3, 2014 at 10:53 Dawid SkrzypczyńskiDawid Skrzypczyński 3111 gold badge4 silver badges17 bronze badges2 Answers
Reset to default 0404 means Not Found. Probably you are connecting to the wrong place, or you didn't map the port from your public IP address to your local IP address.
I solved this problem. If you are using poser to download Ratchet you need to change constructor in /vendor/cboden/ratchet/src/Ratchet/App.php.
Default __construct should look like this:
public function __construct($httpHost = 'localhost', $port = 80, $address = 'localhost', LoopInterface $loop = null) {
So you only need to change httpHost, port and address. It works for me :)
本文标签: javascriptWebsocketError during WebSocket handshake Unexpected response code 404Stack Overflow
版权声明:本文标题:javascript - Websocket - Error during WebSocket handshake: Unexpected response code: 404 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744471330a2607817.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论