prawnsalad / KiwiIRC

This is **DEPRECATED**! Please go to https://github.com/kiwiirc/kiwiirc
https://kiwiirc.com
GNU Affero General Public License v3.0
891 stars 277 forks source link

Closing KiwiIRC in browser does not disconnect it from IRC server #723

Open landergate opened 9 years ago

landergate commented 9 years ago

Using web-client, hosted by KiwiIRC, i see that it's closing connection from IRC server correctly when user closing tab or window.

When using self-hosted KiwiIRC, I'm experiencing this:

  1. User closing KiwiIRC window
  2. User still being online on IRC server
  3. User being kicked from server after timeout [Ping timeout: 186 seconds].

Server: UnrealIRCd

prawnsalad commented 9 years ago
  1. What version of kiwiirc are you using? (check package.json)
  2. Is this happening for all users or just yourself?
  3. Are you using any reverse proxies?
  4. Are you using SSL to connect to your kiwi server?
landergate commented 9 years ago

What version of kiwiirc are you using? (check package.json)

root@services:/home/kiwiirc/KiwiIRC# cat package.json
{
  "name": "kiwiirc",
  "version": "0.9.1",
  "description": "A hand-crafted webirc client",
  "homepage": "https://www.kiwiirc.com/",
  "preferGlobal": "true",
  "bin": {
    "kiwiirc": "./kiwi"
  },
  "man": "./man/kiwiirc.1",
  "repository": {
    "type": "git",
    "url": "https://github.com/prawnsalad/KiwiIRC.git"
  },
  "dependencies": {
    "daemonize2": "0.4.2",
    "engine.io": "^1.4.0",
    "es6-promise": "^1.0.0",
    "eventemitter2": "0.4.14",
    "iconv-lite": "0.4.4",
    "ipaddr.js": "0.1.3",
    "lodash": "2.4.1",
    "negotiator": "0.4.3",
    "node-static": "0.7.4",
    "po2json": "0.3.0",
    "socksjs": "0.4.4",
    "spdy": "1.19.1",
    "uglify-js": "2.4.12",
    "winston": "~0.7.2"
  },
  "engines": {
    "node": ">=0.10"
  }
}

Is this happening for all users or just yourself?

For all users using our hosted KiwiIRC

Are you using any reverse proxies?

Yes! Nginx config looks like this:

server {
    server_name irc.ourdomain.net;

    listen     443 ssl;

    ..................

    location / {
            proxy_set_header X-Real-IP  $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $host;

            proxy_pass http://10.0.2.4:7778;
            proxy_redirect default;

            # Websocket support (from version 1.4)
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
    }
}

Probably it must be the issue? We used practices from here: https://kiwiirc.com/docs/installing/proxies

Are you using SSL to connect to your kiwi server?

No (kiwi and irc server are near to each other)

landergate commented 9 years ago

Tried some experiments with

keepalive_timeout 3s;
send_timeout 3s;
client_header_timeout 3s;
client_body_timeout 3s;

proxy_read_timeout 5s;
proxy_send_timeout 5s;
proxy_connect_timeout 5s;

but user keep disconnecting only since 40-60 sec after closing browser tab.

prawnsalad commented 9 years ago

A few people have reported that enabling SSL on your web server (nginx) solves this kind of issue. This seems to increase stability as some firewalls/proxies actually drop some of the websocket frames.

landergate commented 9 years ago

@prawnsalad Thanks for reply! Well, we have SSL-only already. =]

kiwiirc.com being served with another frontend software, not nginx?

I'll just continue my experiments to find a solution.