Title: Attempting to bind specific interface using interfaces option doesn't work · Issue #193 · python-zeroconf/python-zeroconf · GitHub
Open Graph Title: Attempting to bind specific interface using interfaces option doesn't work · Issue #193 · python-zeroconf/python-zeroconf
X Title: Attempting to bind specific interface using interfaces option doesn't work · Issue #193 · python-zeroconf/python-zeroconf
Description: The documentation implies that Zeroconf(interfaces=[
Open Graph Description: The documentation implies that Zeroconf(interfaces=[
X Description: The documentation implies that Zeroconf(interfaces=[<localIP>]) should restrict listening to one port. But it did not work because the actual socket is bound to all ports. The following patch...
Opengraph URL: https://github.com/python-zeroconf/python-zeroconf/issues/193
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Attempting to bind specific interface using interfaces option doesn't work","articleBody":"The documentation implies that `Zeroconf(interfaces=[\u003clocalIP\u003e])` should restrict listening to one port. But it did not work because the actual socket is bound to all ports. \r\n\r\nThe following patch fixes it.\r\n\r\n```diff\r\n1747c1747\r\n\u003c def new_socket(port: int = _MDNS_PORT) -\u003e socket.socket:\r\n---\r\n\u003e def new_socket(port: int = _MDNS_PORT, address: str = \"\") -\u003e socket.socket:\r\n1778c1778\r\n\u003c s.bind(('', port))\r\n---\r\n\u003e s.bind((address, port))\r\n1840c1840\r\n\u003c respond_socket = new_socket()\r\n---\r\n\u003e respond_socket = new_socket(address=i)\r\n1843c1843\r\n\u003c respond_socket = new_socket(port=0)\r\n---\r\n\u003e respond_socket = new_socket(port=0, address=i)\r\n```\r\n","author":{"url":"https://github.com/kdart","@type":"Person","name":"kdart"},"datePublished":"2019-10-22T21:08:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/193/python-zeroconf/issues/193"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4e1f04ca-1306-7d01-4ab4-e99b1fb93abf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CEF8:1FABE2:E0EA7E:12DD59F:69732705 |
| html-safe-nonce | 8fe58901ebf8fde07ebceca0c538da274ab0f13a890005e9fe023d75caffd6d9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRUY4OjFGQUJFMjpFMEVBN0U6MTJERDU5Rjo2OTczMjcwNSIsInZpc2l0b3JfaWQiOiI3MzU2OTgxMTQxMDE1MDQ1ODkzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 385c1d25f04b7c4d205b70ea56839c4b630d02267c92ed2b3855f4dd5aa8c79e |
| hovercard-subject-tag | issue:510916007 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-zeroconf/python-zeroconf/193/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8530280be2aa21c9200a3a5173184a86f18352d52a0f50a4ef8d2bf2ab5ac598/python-zeroconf/python-zeroconf/issues/193 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8530280be2aa21c9200a3a5173184a86f18352d52a0f50a4ef8d2bf2ab5ac598/python-zeroconf/python-zeroconf/issues/193 |
| og:image:alt | The documentation implies that Zeroconf(interfaces=[ |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kdart |
| hostname | github.com |
| expected-hostname | github.com |
| None | 44ab3188c1dcfe3be0f9c3feca2e04e14fb79f120939ce2395e4f15ab96ec1d4 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-zeroconf/python-zeroconf git https://github.com/python-zeroconf/python-zeroconf.git |
| octolytics-dimension-user_id | 120192235 |
| octolytics-dimension-user_login | python-zeroconf |
| octolytics-dimension-repository_id | 21548731 |
| octolytics-dimension-repository_nwo | python-zeroconf/python-zeroconf |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 21548731 |
| octolytics-dimension-repository_network_root_nwo | python-zeroconf/python-zeroconf |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a5e2b48bd1260476599758f5d253b5d24092ab84 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width