Commit b59da8e87c

b59da8e87c182bc8c19276c0ee945f9ff1f1cb59

parent: fc47f7cd83

Unsigned

Darafei Praliaskouski <me@komzpa.net> · 2026-07-10 14:32 UTC
committer: <strk@kbt.io>

fix: make remote SSO callbacks tunnelable

Layout: unified · split

README.md +6
@@ -157,6 +157,12 @@ _(replace the placeholders in brackets [] with your own details)_:
157157 If the homeserver advertises single sign-on, leave the password empty to use
158158 it. WeeChat will print a login URL when you connect.
159159
160 The SSO callback listens on `127.0.0.1:29325` on the WeeChat host. When
161 WeeChat runs on another machine, create an SSH tunnel before connecting so
162 the browser's localhost callback reaches it:
163
164 ssh -L 29325:127.0.0.1:29325 user@weechat-host
165
1601663. Now try to connect. The first connection can take a few minutes while the
161167 client syncs the account:
162168
src/connection.rs +8 −1
@@ -42,6 +42,7 @@ use matrix_sdk::{
4242 OwnedDeviceId, OwnedEventId, OwnedRoomId, OwnedTransactionId,
4343 },
4444 sync::State,
45 utils::local_server::LocalServerBuilder,
4546 Client, LoopCtrl, Result as MatrixResult, RoomMemberships,
4647};
4748
@@ -53,6 +54,7 @@ use crate::{
5354};
5455
5556const DEFAULT_SYNC_TIMEOUT: Duration = Duration::from_secs(30);
57const SSO_CALLBACK_PORT: u16 = 29_325;
5658
5759pub struct InteractiveAuthInfo {
5860 pub user: String,
@@ -435,7 +437,12 @@ impl Connection {
435437 Ok(())
436438 }
437439 })
438 .initial_device_display_name("WeeChat-Matrix-rs");
440 .initial_device_display_name("WeeChat-Matrix-rs")
441 .server_builder(
442 LocalServerBuilder::new().port_range(
443 SSO_CALLBACK_PORT..SSO_CALLBACK_PORT + 1,
444 ),
445 );
439446
440447 if let Some(device_id) = device_id.as_ref() {
441448 builder = builder.device_id(device_id);