Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to set listening address family #1665

Closed
aler9 opened this issue Apr 7, 2023 · 10 comments
Closed

Add option to set listening address family #1665

aler9 opened this issue Apr 7, 2023 · 10 comments
Labels
enhancement New feature or request general

Comments

@aler9
Copy link
Member

aler9 commented Apr 7, 2023

Describe the feature

This allows to stop listening on IPv6 as requested in #1385

Prototype:

# whether to use IPv4, IPv6 or both.
addressFamily: any|ipv4|ipv6
@aler9
Copy link
Member Author

aler9 commented Apr 10, 2023

@pikachu937 in the end i didn't add an option, but hacked the server in order to listen on IPv4 only when listen IP is 0.0.0.0. This is the only one problematic IP, while in every other case the server listen only on the address family of the listen IP.

@aler9 aler9 closed this as completed Apr 10, 2023
@pikachu937
Copy link

pikachu937 commented Apr 13, 2023

i checked and this work only if set in config file ip address and port - 0.0.0.0:55544

rtspDisable: no
protocols: [udp, tcp]
rtspAddress: 0.0.0.0:55544
rtpAddress: 0.0.0.0:22222
rtcpAddress: 0.0.0.0:22223

but, this is does not work if set in config file only port :55544(by default in config file)

rtspDisable: no
protocols: [udp, tcp]
rtspAddress: :55544
rtpAddress: :22222
rtcpAddress: :22223

can you make it automatically detect and not have to set a separate IP address?

@aler9
Copy link
Member Author

aler9 commented Apr 13, 2023

@pikachu937 that's exactly as intended. When a user wants to listen on IPv4 only, he can set the listen IP to 0.0.0.0, if he wants to listen on IPv6 only he can set the listen IP to [::1], otherwise the server listens on all IP families. This is more versatile than checking the OS setting (that is something OS-dependent that may not be possible to implement on all supported platforms), since it allows to disable listening on IPv6 even when IPv6 is enabled on the OS.

@pikachu937
Copy link

pikachu937 commented Apr 13, 2023

hmm… if look from this side, it is logical and really works correctly. but wouldn't it be easier to do as you originally suggested through a separate setting:

# whether to use IPv4, IPv6 or both.
addressFamily: any|ipv4|ipv6

I just think it's more obvious, but like everyone else, I could be wrong

@aler9
Copy link
Member Author

aler9 commented Apr 13, 2023

added in v0.22.1

@longdq01
Copy link

Hi I add option "addressFamily" but it's not working (v0.23.8 armv7)
image

@longdq01
Copy link

I'm listening hls address via vpn localhost:8888 -> 10.8.0.3:8888. but when I using localhost it's work, vpn return 404

@aler9
Copy link
Member Author

aler9 commented Aug 12, 2023

@ftvdexcz as written above, the "addressFamily" parameter was not added but instead the server was edited in order to listen on IPv4 when a listening address contains an IPv4 IP.

Open a dedicated issue if you have problems and describe how to replicate them.

@longdq01
Copy link

@aler9 Thanks you for quick response! I'm struggling when connect via vpn. Issue describe in #2175

Copy link
Contributor

This issue is being locked automatically because it has been closed for more than 6 months.
Please open a new issue in case you encounter a similar problem.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request general
Projects
None yet
Development

No branches or pull requests

3 participants