Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error reading from socket every 2 mins #123

Closed
Applepi opened this issue Oct 17, 2019 · 2 comments
Closed

Error reading from socket every 2 mins #123

Applepi opened this issue Oct 17, 2019 · 2 comments

Comments

@Applepi
Copy link

@Applepi Applepi commented Oct 17, 2019

When using the plugin I'm getting disconnected every 2mins and it's reconnecting just fine. My home server is behind an NGINX proxy

    location / {
        proxy_pass      http://10.30.0.241:8008;
        proxy_set_header X-Forwarded-For $remote_addr;
    }
    location /.well-known/matrix/server {
      return 200 '{"m.server": "matrix.treyead.tech:443"}';
      add_header Content-Type application/json;
    }

    location /.well-known/matrix/client {
      return 200 '{"m.homeserver": {"base_url": "https://matrix.treyead.tech"},"m.identity_server": {"base_url": "https://vector.im"}}';
      add_header Content-Type application/json;
      add_header "Access-Control-Allow-Origin" *;
    }
[server]
matrix.autoconnect = on
matrix.address = "matrix.treyead.tech"
matrix.port = 443
matrix.proxy = ""
matrix.ssl_verify = on
matrix.username = "****"
matrix.password = "****"
matrix.device_name = "Treyead Matrxi"
matrix.autoreconnect_delay = 10
matrix.sso_helper_listening_port = 0
              │15:02:24   matrix  -- | matrix: Error while reading from socket
               │15:02:24   matrix  -- | matrix: disconnecting from server...
               │15:02:24   matrix  -- | matrix: disconnected from server
               │15:02:24   matrix  -- | matrix: reconnecting to server in 10 seconds
               │15:02:35   matrix  -- | matrix: reconnecting to server...
               │15:02:35   matrix  -- | matrix: Connecting to matrix.treyead.tech:443 (SSL)...
               │15:02:35   matrix  -- | matrix: Doing SSL handshake...
               │15:02:36   matrix  -- | matrix: Connected using TLSv1.2, and 256 bit ECDHE-RSA-AES256-GCM-SHA384 cipher suite.
               │15:02:36   matrix  -- | matrix: received certificate
               │15:02:36   matrix     |  - certificate info:
               │15:02:36   matrix     |     - subject: commonName=matrix.treyead.tech, serial number
               │15:02:36   matrix     |         03C805AC2F728052B8398625500D95F1B480
               │15:02:36   matrix     |     - issuer: countryName=US, organizationName=Let's Encrypt,
               │15:02:36   matrix     |         commonName=Let's Encrypt Authority X3
               │15:02:36   matrix     |     - key info: RSA key 4096 bits, signed using
               │15:02:36   matrix     |         sha256WithRSAEncryption
               │15:02:36   matrix     |     - period of validity:
               │15:02:36   matrix     |         Begins on:  Aug 19 20:18:23 2019 GMT
               │15:02:36   matrix     |         Expires on: Nov 17 20:18:23 2019 GMT
               │15:02:36   matrix     |     - fingerprints:
               │15:02:36   matrix     |         SHA1:   38:BD:CB:52:97:C5:A8:5F:52:75:77:62:B0:D4:8C:12:02:0E:6B:2B
               │15:02:36   matrix     |         SHA256: A8:DC:16:F4:14:AD:1D:EA:E1:16:1B:AB:4D:07:CF:22:3F:0E:90:00:D5:FF:85:A9:3E:A8:85:C5:F5:8F:53:BF
               │15:02:36   matrix  -- | matrix: Already logged in, syncing...
@poljar

This comment has been minimized.

Copy link
Owner

@poljar poljar commented Oct 18, 2019

Weechat-matrix uses a single socket and keep-alive to connect to servers. Because of that it's quite important to enable HTTP 2 and bump the http2_max_requests setting on your reverse proxy to a quite high number.

@Applepi

This comment has been minimized.

Copy link
Author

@Applepi Applepi commented Oct 18, 2019

Yep that resolved the issue, it seems HTTP2 wasn't enabled on my proxy; adding

listen      %ip%:%proxy_ssl_port% ssl http2;
http2_max_requests 10000;

appears to have resolved the issue. Thank you so much for your help.

@Applepi Applepi closed this Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.