The API for connecting to WebSockets in browsers unfortunately doesn't support setting any Authorization header. This means that before this commit it was impossible to connect to the API relay from a web browser. The only thing that can be set apart from the URL is the Sec-WebSocket-Protocol header. Therefore this allows you to send the auth token in this header. This is a weird way to send auth, but it seems to be the best one that makes it possible for browsers to connect. Kubernetes also does it this way: https://github.com/kubernetes/kubernetes/pull/47740 Here is a post describing the different ways to make it possible for a browser to authenticate against a websocket connection, and it also recommends doing it this way: https://stackoverflow.com/questions/4361173/http-headers-in-websockets-client-api/77060459#77060459 Note that when this header is used to pass auth, the client also needs to specify the `api.weechat` sub protocol. This is because the client and server have to agree on a sub protocol when this header is specified, and in order to not send the fake protocol used for auth back to the client, we require specifying the protocol `api.weechat`, which the server then returns to the client. This is only necessary when the Sec-WebSocket-Protocol header is used. If the Authorization header is used for auth as before, nothing changes.
WeeChat
WeeChat (Wee Enhanced Environment for Chat) is a free chat client, fast and light, designed for many operating systems.
It is highly customizable and extensible with scripts.
Homepage: https://weechat.org/
Features
- Modular chat client: WeeChat has a lightweight core and optional plugins. All plugins (including IRC) are independent and can be unloaded.
- Multi-platform: WeeChat runs on GNU/Linux, *BSD, GNU/Hurd, Haiku, macOS and Windows (Bash/Ubuntu and Cygwin).
- Multi-protocols: WeeChat is designed to support multiple protocols by plugins, like IRC.
- Standards-compliant: the IRC plugin is compliant with RFCs 1459, 2810, 2811, 2812, 2813 and 7194.
- Small, fast, and very light: the core is and should stay as light and fast as possible.
- Customizable and extensible: there are a lot of options to customize WeeChat, and it is extensible with C plugins and scripts (Perl, Python, Ruby, Lua, Tcl, Scheme, JavaScript and PHP).
- Fully documented: there is comprehensive documentation, which is translated into several languages.
- Developed from scratch: WeeChat was built from scratch and is not based on any other client.
- Free software: WeeChat is released under GPLv3.
On WeeChat's website you can find more screenshots.
Installation
WeeChat can be installed using your favorite package manager (recommended) or by compiling it yourself.
For detailed instructions, please check the WeeChat user's guide.
Semantic versioning
WeeChat is following a "practical" semantic versioning, see file CONTRIBUTING.md.
Copyright
Copyright © 2003-2024 Sébastien Helleu
This file is part of WeeChat, the extensible chat client.
WeeChat is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
WeeChat is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with WeeChat. If not, see https://www.gnu.org/licenses/.

