-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core: bind to localhost rather than all interfaces (#2589)
Summary: Prior to this change, TensorBoard would default to serving on the entire local network; now, TensorBoard serves to the local machine only, and the flag `--bind_all` can be used to dual-bind to IPv4 and IPv6 on the entire local network (the previous default). See #2387 and comments therein for details. Test Plan: On my Debian machine, running with `strace -e trace=%network`: - running with no `--host` flag: - can connect to loopback on IPv4 only - cannot connect over LAN - `strace` shows binding on `AF_INET` - a notice about `--bind_all` is printed to stderr - running with `--host=localhost`: - same behavior as with no `--host` flag, but no notice is printed - running with `--host='::1'`: - can connect to loopback on IPv6 only - cannot connect over LAN - `strace` shows binding on `AF_INET6` - running with `--host=0.0.0.0`: - can connect to loopback on IPv4 only - **can** connect over LAN - `strace` shows binding on `AF_INET` - running with `--host='::0'`: - can connect on both IPv4 and IPv6 - **can** connect over LAN - `strace` shows binding on `AF_INET6` - running with `--bind_all`: - can connect on both IPv4 and IPv6 - **can** connect over LAN - `strace` shows binding on `AF_INET6` with an additional syscall to `setsockopt(3, SOL_IPV6, IPV6_V6ONLY, [0], 4)` to facilitate the dual-binding, which is not present in any other tested case In all cases, the printed serving URL (“TensorBoard x.y.z running at…”) bears the exact `--host` flag, or my full hostname if `--bind_all` was given, or `localhost` if neither was given. In all cases, the URL is a clickable link in my `gnome-terminal`. Note that on my system dual binding to `::0` works without an explicit syscall—i.e., `IPV6_V6ONLY` defaults to `0`—but this is not portable. Connection testing was performed via ```shell for ipv in 4 6; do if curl -sfL -"${ipv}" localhost:6006/data/logdir >/dev/null; then printf 'v%d OK\n' "${ipv}" else printf 'v%d FAIL\n' "${ipv}" fi done ``` in all cases. wchargin-branch: localhost-only
- Loading branch information
Showing
5 changed files
with
57 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters