Skip to content

feat: configurable listen address and port ranges - #12

Open
DarkCat09 wants to merge 7 commits into
chatmail:mainfrom
DarkCat09:dc09/config-addr
Open

feat: configurable listen address and port ranges#12
DarkCat09 wants to merge 7 commits into
chatmail:mainfrom
DarkCat09:dc09/config-addr

Conversation

@DarkCat09

@DarkCat09 DarkCat09 commented Mar 4, 2026

Copy link
Copy Markdown

Fixes #8
Supersedes #7

Thanks to @pvagner for the initial implementation

@pvagner

pvagner commented Mar 5, 2026

Copy link
Copy Markdown

@DarkCat09 This looks way more readable than the PR it supersedes, however I am failing to get it to run as intended.

chatmail-turn --realm cmail.pvagner.sk --socket /run/chatmail-turn/turn.socket --listen 192.168.0.98:33478 --relay-addr 91.219.133.64:55500-55600
Listening on public IP: 192.168.0.98

thread 'main' (591) panicked at src/main.rs:168:10:
called `Result::unwrap()` on an `Err` value: Failed to bind Unix socket

Caused by:
    No such file or directory (os error 2)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Also I'm thinking we have lost a bit of functionality as I'd like to keep listening on both ipv4 local address with the relay and ipv6 public one.

@DarkCat09

Copy link
Copy Markdown
Author

@pvagner

No such file or directory

Please check that /run/chatmail-turn exists

both ipv4 local address and ipv6 public one

I guess i can implement specifying multiple addresses like: --listen 1.2.3.4:1234 --listen 4.5.6.7:4567
Does this solve your task?

@pvagner

pvagner commented Mar 5, 2026

Copy link
Copy Markdown

Please check that /run/chatmail-turn exists

Oh yes, that's my bad. Works fine.

I guess i can implement specifying multiple addresses like: --listen 1.2.3.4:1234 --listen 4.5.6.7:4567
Does this solve your task?

If auto for ipv6 will be possible that would be great.

--listen ipv.4.address.here:1234 --listen :1234

I'm thinking that this should even allow ipv4 only peers to talk to ipv6 only peers when turnserver machine has both ipv4 and ipv6 connectivity and relay address is setup correctly for ipv4.

Also I have issues connecting if both the call parties are behind a nat.

I am seeing that you are setting up RelayAddressGeneratorRanges like this:

relay_address: relay_ip,
            address: relay_ip.to_string(),

Shouldn't the address be the listen_ip.to_string() rather than relay_ip.to_string() ?

Thanks once again for making it so awesome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow configuration of UDP port range

2 participants