// SPDX-FileCopyrightText: 2003-2026 Sébastien Helleu // SPDX-FileCopyrightText: 2014-2019 Ryuunosuke Ayanokouzi // // SPDX-License-Identifier: GPL-3.0-or-later = WeeChat リレープロトコル :author: Sébastien Helleu :email: flashcode@flashtux.org :lang: ja-jp include::includes/attributes-ja.adoc[] [[introduction]] == はじめに この文書は _weechat_ リレープロトコルについて述べたものです: リレープロトコルとは、WeeChat データをクライアントに中継するためのもので、多くの場合クライアントはリモートインターフェースを指します。 [[terminology]] === 用語 この文書では以下の用語を利用します: * _リレー_: これは relay プラグインを備えた WeeChat を指し、"サーバ" のように振る舞い、_クライアント_ からの接続を受け付けます * _クライアント_: これは他のソフトウェアのことを指し、ネットワークを介して _リレー_ に接続します; 多くの場合、_クライアント_ はリモートインターフェースのことを指します。 [[network_diagram]] === ネットワーク図 以下の図に示すように _クライアント_ は _リレー_ に接続しています: include::includes/relay.ja.adoc[tag=diagram] // TRANSLATION MISSING [NOTE] All clients here are clients using _weechat_ protocol in _relay_ plugin. + The _relay_ plugin also allows _api_ and _irc_ protocols (not described in this document). [[protocol_generalities]] == プロトコルの一般的説明 * _リレー_ プラグインは新しい接続を受け入れるために IP/port をリッスンし、_クライアント_ は TCP ソケットを使って _リレー_ に接続します。 * _クライアント_ の数はオプション _relay.network.max_clients_ で制限されています。 * それぞれの _クライアント_ が自分以外のクライアントと協調して動くことはできません。 * _クライアント_ から _リレー_ へのメッセージを _コマンド_ と呼び、これはテキスト形式 (文字列) で送信されます。 * _リレー_ から _クライアント_ へのメッセージを _メッセージ_ と呼び、これはバイナリデータとして送信されます。 [[commands]] == コマンド (クライアント → リレー) コマンドの書式は以下です: ---- (id) command arguments\n ---- フィールドは: * _id_: _リレー_ からの応答に含まれる任意指定のメッセージ識別子; 識別子は必ず括弧で括り、アンダースコアを最初につけるのは禁止されています (アンダースコアが最初についている識別子は WeeChat _event_ メッセージ用に予約されています) * _command_: コマンド (以下のテーブルを参照) * _arguments_: コマンドに対する任意指定の引数 (複数の引数を渡す場合は空白で区切ってください)。 利用可能なコマンドのリスト (詳しくは次の章を参照): [width="100%",cols="1m,8",options="header"] |=== | コマンド | 説明 // TRANSLATION MISSING | handshake | Handshake: prepare client authentication and set options, before _init_ command. | init | _リレー_ 接続を初期化 | hdata | _hdata_ を要求 | info | _インフォ_ を要求 | infolist | _インフォリスト_ を要求 | nicklist | _ニックネームリスト_ を要求 | input | バッファにデータを送信 (テキストまたはコマンド) // TRANSLATION MISSING | completion | Request completion of a string. | sync | バッファを同期: バッファの最新情報を取得 | desync | バッファを非同期: バッファの更新を止める | quit | _リレー_ から切断 |=== // TRANSLATION MISSING [[command_handshake]] === handshake // TRANSLATION MISSING _WeeChat ≥ 2.9, updated in versions 3.5, 4.0.0._ Perform an handshake between the client and WeeChat: this is required in most cases to know the session settings and prepare the authentication with the _init_ command. Only one handshake is allowed before the _init_ command. Syntax: ---- (id) handshake [