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 --host option to docc preview #713

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Commits on Sep 27, 2023

  1. Specify host name in PreviewServer.Bind.localhost

    `ServerBootstrap.bind` needs to know which host name to bind a socket
    to, but we were hardcoding it to `localhost` without providing a way for
    a different host to be provided. By adding a `host:` element to
    `PreviewServer.Bind.localhost`, we require the caller of
    `PreviewServer.init` to be specific about which host they want.
    tomstuart committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    6543d4b View commit details
    Browse the repository at this point in the history
  2. Include host name in PreviewServer error messages

    If there’s a problem binding to a local port, the specific host name
    might be relevant.
    tomstuart committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    2a1539a View commit details
    Browse the repository at this point in the history
  3. Add host: parameter to PreviewAction.init

    Now that `PreviewServer` requires an explicit host name, we should
    require one here too instead of hardcoding `localhost`.
    tomstuart committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    f8be787 View commit details
    Browse the repository at this point in the history
  4. Add --host option to PreviewOptions

    This retains the `localhost` default host name for the preview server,
    but allows the user to override it by providing `--host`.
    
    We’re only supporting the long `--host` option because `-h` already
    means `--help`.
    tomstuart committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    e4cc3c1 View commit details
    Browse the repository at this point in the history
  5. Add --host advice to docc preview instructions

    Because `localhost` only allows connections on the loopback interface,
    anybody who’s trying to run `docc preview` on a remote server and
    connect to it with their local browser will need to use `--host 0.0.0.0`
    or similar.
    tomstuart committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    845db03 View commit details
    Browse the repository at this point in the history