Galène videoconferencing server discussion list archives
 help / color / mirror / Atom feed
* [Galene] Turn binding to the ANY Address - even when specified
@ 2025-01-15 11:30 Dirk-Willem van Gulik
  2025-01-15 14:03 ` [Galene] " Juliusz Chroboczek
  0 siblings, 1 reply; 3+ messages in thread
From: Dirk-Willem van Gulik @ 2025-01-15 11:30 UTC (permalink / raw)
  To: galene

When starting galene with an explcit IP Address on a machine with multiple Ip addresses; e.g. with:

	./galene  -turn 11.123.4.123:1194 ....

netstat/lsof shows that it is still bound to the ANY address:

	  # lsof -n | grep LISTEN
	   ....
	   galene    49935 galene    7u     IPv4 0xfffff80019daf000        0     TCP *:1194->*:* (LISTEN)

Is this the expected behaviour (i.e. intentional and for a reason) - or a blemish/thing that I should try to fix ?

With kind regards,

Dw.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Galene] Re: Turn binding to the ANY Address - even when specified
  2025-01-15 11:30 [Galene] Turn binding to the ANY Address - even when specified Dirk-Willem van Gulik
@ 2025-01-15 14:03 ` Juliusz Chroboczek
  2025-01-15 15:56   ` Dirk-Willem van Gulik
  0 siblings, 1 reply; 3+ messages in thread
From: Juliusz Chroboczek @ 2025-01-15 14:03 UTC (permalink / raw)
  To: Dirk-Willem van Gulik; +Cc: galene

> When starting galene with an explcit IP Address on a machine with multiple Ip addresses; e.g. with:
> 
> 	./galene  -turn 11.123.4.123:1194 ....
> 
> netstat/lsof shows that it is still bound to the ANY address:
> 
> 	  # lsof -n | grep LISTEN
> 	   ....
> 	   galene    49935 galene    7u     IPv4 0xfffff80019daf000        0     TCP *:1194->*:* (LISTEN)
> 
> Is this the expected behaviour (i.e. intentional and for a reason) - or
> a blemish/thing that I should try to fix ?

Only the address you specified is advertised to clients, but the server
listens on the wildcard address.  This allows us to change the server's
address without tearing down the socket when running with "-turn auto".

It would make the code moderately more complex to change that, so let me
know if it's important for you.

-- Juliusz

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Galene] Re: Turn binding to the ANY Address - even when specified
  2025-01-15 14:03 ` [Galene] " Juliusz Chroboczek
@ 2025-01-15 15:56   ` Dirk-Willem van Gulik
  0 siblings, 0 replies; 3+ messages in thread
From: Dirk-Willem van Gulik @ 2025-01-15 15:56 UTC (permalink / raw)
  To: Juliusz Chroboczek; +Cc: galene

[-- Attachment #1: Type: text/plain, Size: 2053 bytes --]



> On 15 Jan 2025, at 15:03, Juliusz Chroboczek <jch@irif.fr> wrote:
> 
>> When starting galene with an explcit IP Address on a machine with multiple Ip addresses; e.g. with:
>> 
>> 	./galene  -turn 11.123.4.123:1194 ....
>> 
>> netstat/lsof shows that it is still bound to the ANY address:
>> 
>> 	  # lsof -n | grep LISTEN
>> 	   ....
>> 	   galene    49935 galene    7u     IPv4 0xfffff80019daf000        0     TCP *:1194->*:* (LISTEN)
>> 
>> Is this the expected behaviour (i.e. intentional and for a reason) - or
>> a blemish/thing that I should try to fix ?
> 
> Only the address you specified is advertised to clients, but the server
> listens on the wildcard address.  This allows us to change the server's
> address without tearing down the socket when running with "-turn auto".

So I think below is a fairly simple change - where the 'auto' case is kept as is - and the listener is ONLY bound to a specific IP if it is specified. Otherwise it becomes *:1234 or a found public IP address.

So now [-turn [ip|fqdn]:<port>] behaves exactly like -http.

> So let me know if it's important for you.


So being able to bind it is convenient on a machine with multiple IPs or a machine that straddles networks. As otherwise the galene starting `second' looses the race for 0.0.0.0. . Or a machine with an anal firewall/ACL system - the listen() gets a permission error.

With kind regards,

Dw.


diff --git a/turnserver/turnserver.go b/turnserver/turnserver.go
index 1dcebe0..2210801 100644
--- a/turnserver/turnserver.go
+++ b/turnserver/turnserver.go
@@ -132,7 +132,7 @@ func Start() error {
                if a == nil {
                        return errors.New("couldn't parse address")
                }
-               pcc, lc := listener(net.IP{0, 0, 0, 0}, addr.Port, a)
+               pcc, lc := listener(a, addr.Port, a)
                if pcc != nil {
                        pccs = append(pccs, *pcc)
                        server.addresses = append(server.addresses, &net.UDPAddr{


[-- Attachment #2: Type: text/html, Size: 11924 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-01-15 16:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-15 11:30 [Galene] Turn binding to the ANY Address - even when specified Dirk-Willem van Gulik
2025-01-15 14:03 ` [Galene] " Juliusz Chroboczek
2025-01-15 15:56   ` Dirk-Willem van Gulik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox