WeeChat DevCenter

Tag - relay

Entries feed

Friday, January 7 2022

Zstandard compression in relay plugin

Zstandard compression has been added in weechat protocol of relay plugin (see important notes in the release notes).

It offers better and faster compression (on WeeChat side) and faster decompression (client side).

Example of a small message (53KB), default compression (20):

   WeeChat: obj: 2964/53611 bytes (zstd: 95%, 0,12ms)
   Client: decompressed (zstd): 53606 bytes, ratio: 95%, parsed in 0.67ms)
   WeeChat: obj: 3752/53611 bytes (zlib: 94%, 0,23ms), id: quiet
   Client: decompressed (zlib): 53606 bytes, ratio: 94%, parsed in 2.10ms)

Example of a big message (2.3MB), default compression (20):

   WeeChat: obj: 133280/2376095 bytes (zstd: 95%, 2,97ms), id: quiet
   Client: decompressed (zstd): 2376090 bytes, ratio: 95%, parsed in 15.03ms)
   WeeChat: obj: 345255/2376095 bytes (zlib: 86%, 12,72ms), id: quiet
   Client: decompressed (zlib): 2376090 bytes, ratio: 86%, parsed in 21.20ms)

So with the same compression level:

  • zstd is up to 4x faster on compression than zlib (WeeChat side)
  • zstd is up to 3x faster on decompression than zlib (client side)
  • compressed packets are up to 2.6x smaller with zstd than zlib.

Monday, January 14 2019

Support of TOTP

TOTP (Time-based One-Time Password) support has been added in WeeChat, which can now generate and check TOTP validity.

A TOTP is generated with:

  • the secret (encoded in base 32),
  • the time (by default 0, which is the current time),
  • the number of digits (4 to 10 digits are supported, 6 is the default and recommended value).

Relay plugin

The TOTP can be used as second authentication factor in the relay plugin, with two new options:

  • relay.network.totp_secret: the TOTP secret, encoded in base 32
  • relay.network.totp_window: the allowed window: number of TOTP allowed before and after the current time window.

For example to set the secret using secured data (just replace "xxxxx" by your secret in base 32):

/secure set relay_totp_secret xxxxx
/set relay.network.totp_secret "${sec.data.relay_totp_secret}"

Then your relay client must support and send the TOTP value, in addition to the password, in the "init" command:

init password=secretpassword,totp=123456

If the password is valid and that TOTP is valid for the current time, the authentication is successful.

Infos / eval

You can also generate or validate TOTP with two new infos in WeeChat:

  • totp_generate: generate a TOTP
  • totp_validate: validate a TOTP

For example to show the value of TOTP for the secret "secretbase32", current time, with 6 digits:

/eval -n ${info:totp_generate,secretbase32,0,6}

Documentation

You can read more about TOTP in the docs:

Sunday, February 10 2013

WebSocket in relay plugin

Websocket has been added in relay plugin, for IRC and WeeChat protocols.

It is an experimental and partial implementation of RFC 6455: fragmentation and control frames are not yet supported.

The relay plugin automatically detects WebSocket handshake and if everything is OK (origin allowed and required headers received), an answer to handshake is sent and then socket is ready to send/receive WebSocket frames.

Text and binary data are supported, so IRC (text/text) and WeeChat (text/binary) protocols are supported.

Screenshot (click for full size):

relay_websocket.png

Tuesday, February 5 2013

Test script for relay protocol

A test script called testproto.py has been added in QWeeChat to test the relay protocol with WeeChat. This script runs in terminal and does not require Qt.

Script is located in path src/qweechat/weechat/testproto.py of QWeeChat repository.

Screenshot (click for full size):

testproto.png

Monday, December 24 2012

Backlog for irc protocol in relay

Backlog has been added for irc protocol in relay plugin.

The relay plugin now supports server capability "server-time", to include the messages time as tag (not in the message itself).

5 new options have been added:

  • relay.irc.backlog_max_minutes
  • relay.irc.backlog_max_number
  • relay.irc.backlog_since_last_disconnect
  • relay.irc.backlog_tags
  • relay.irc.backlog_time_format

Enjoy, and merry Christmas!

Friday, July 27 2012

SSL in Relay plugin

SSL support has been added in Relay plugin, for irc and weechat protocols.

A new option has been added to set the certificate and private key to use:

  • relay.network.ssl_cert_key: path to file with certificate and private key (default: ~/.weechat/ssl/relay.pem)

The file can be created with following commands:

$ mkdir -p ~/.weechat/ssl
$ cd ~/.weechat/ssl
$ openssl req -nodes -newkey rsa:2048 -keyout relay.pem -x509 -days 365 -out relay.pem

In WeeChat :

/relay sslcertkey

And add relays with SSL, for example:

/relay add ssl.irc.freenode 8001
/relay add ssl.weechat 9001

And now WeeChat will serve clients on these ports using SSL, enjoy!

Sunday, December 25 2011

QWeeChat - Python/Qt GUI

Christmas gift: "QWeeChat", the first remote interface for WeeChat. It is written in Python, using Qt toolkit.

This is an alpha version of this interface, only some features are implemented, but it's usable as-is.

The source code is available on download page, and requires latest development version of WeeChat.
New versions will follow, as well as interfaces for other systems like mobile devices (first should be Android).

A screenshot of QWeeChat in action (click for full size):

Urlserver

Merry Christmas and happy new year 2012 with WeeChat and QWeeChat!