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

Support specifying which IP addresses to listen on #526

Merged
merged 14 commits into from
Feb 6, 2024

Conversation

agners
Copy link
Collaborator

@agners agners commented Feb 5, 2024

Allow to define which IP addresses to bind the WebSocket server on. This is especially useful to limit which addresses the add-on will listen on since it runs in host network context.

Allow to define which IP addresses to bind the WebSocket server on. This
is especially useful to limit which addresses the add-on will listen on
since it runs in host network context.
@agners agners requested a review from marcelveldt February 5, 2024 12:43
@agners agners added the new-feature New feature or request label Feb 5, 2024
@MartinHjelmare MartinHjelmare changed the title Support specifyiing which IP addresses to listen on Support specifying which IP addresses to listen on Feb 5, 2024
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
@agners agners requested a review from MartinHjelmare February 5, 2024 13:34
@marcelveldt
Copy link
Collaborator

see the linter error from mypy

@agners
Copy link
Collaborator Author

agners commented Feb 6, 2024

see the linter error from mypy

Ugh, yeah I see TCPSite supports only a single string as host, whereas the underlying loop.create_server supports a list. We've run into this limitation in the Core already (see https://github.com/home-assistant/core/blob/2024.2.0b8/homeassistant/components/http/web_runner.py#L14).

I've now added a similar implementation here too.

@bdraco do you think we can add something like that to aiohttp? 🥺

@agners agners merged commit 03309d9 into main Feb 6, 2024
4 checks passed
@agners agners deleted the support-listen-address-arg branch February 6, 2024 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants