nchan icon indicating copy to clipboard operation
nchan copied to clipboard

Client keeps making requests rather than waiting for activity

Open edwh opened this issue 5 years ago • 3 comments

Doubtless this is my fault in some way, but I could use some help.

Here's my config:

  server {
    listen 555 ssl;
    server_name ...removed;

    # SSL settings
...removed

    location = /subscribe {
      nchan_subscriber;
      nchan_channel_id $arg_id;
    }

    location = /publish {
      nchan_publisher;
      nchan_channel_id $arg_id;
    }

    location /nchan_stub_status {
      nchan_stub_status;
    }
  }

I'm using the nchan NPM client. About every second, I can see that a request is being made to my channel, which returns with 101 Switching protocols.

image

Why would this be happening so frequently?

If I connect using a browser then I rapidly get ERR_EMPTY_RESPONSE errors.

Adding an 'on' handler for errors I see lots of errors saying "Error during WebSocket handshake: net::ERR_CONNECTION_RESET" or "Error during WebSocket handshake: Unexpected response code: 507". But these are not once per second.

Much less frequently, I see it return storage errors; I'm not worried about this as I have a periodic restart but I mention it in case it's relevant.

edwh avatar Dec 10 '19 18:12 edwh

Anyone seen this?

edwh avatar Dec 18 '19 12:12 edwh

I haven't seen this issue before. Is there anything odd in the Nginx error log?

slact avatar Dec 22 '19 20:12 slact

Thanks for your reply. I get this log repeatedly

2019/12/22 20:28:38 [alert] 14783#0: *6237902 header already sent while keepalive, client: 185.201.34.38, server: 0.0.0.0:555
2019/12/22 20:28:39 [alert] 14791#0: *6238003 header already sent while keepalive, client: 185.201.34.38, server: 0.0.0.0:555
2019/12/22 20:28:39 [alert] 14793#0: *6238018 header already sent while keepalive, client: 185.201.34.38, server: 0.0.0.0:555
2019/12/22 20:28:40 [alert] 14805#0: *6238127 header already sent while keepalive, client: 185.201.34.38, server: 0.0.0.0:555

edwh avatar Dec 22 '19 20:12 edwh