ollyxar/websockets-chat

Doesn't work with nGinx. Connections are reset. Regular nodeJS server are working fine

Closed this issue · 8 comments

2018/07/21 08:07:24 [error] 8617#8617: *808 recv() failed (104: Connection reset by peer) while reading response header from upstream.

While nodejs sockets are working fine, even with TLS.

This is normal error. When client disconnected abnormally you'll see this error.
If you don't care about lost connection you can ignore it. But if you want to implement some functionality to restore connection or notify about it then you could use this error.

Hi I tried. I like the multi-thread but the server just doesn't work on nGinx with load balancing. Other libraries (also PHP) work fine. There something wrong with the code.

Ah, I got it. This server is "standalone". It's completely independent. No need to nginx or other web-server. You just have to start it once. This component dedicated for small simple chats.
If you're looking for load-balanced websocket-server then you could use another repo

Yes I tried that one as well because it was plain. Same issues. It doesn't even accepts the connection request. Thats how far I got. Then I was done with it. I know use this one: https://github.com/heminei/php-websocket but that one isn't multi-threading :(

Well, ok, you can turn logger on and see what's happened. Maybe you have not complete setting up server? First of all I'd suggest you to set up server without SSL (to make sure that it is not certificate issue). Then start server from console mode with Logger::enable(). And I believe that you'll find what's wrong.

I will give it a last try tomorrow. Maybe I will reach out for your help ;)

Great! Anyway you can post piece of log here and I'll try to find/explain what's going on.