Redocly / Redocly/redocly-cli

Preview docs using localhost instead of 127.0.0.1

Open
#452 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

p3 Type: Enhancement
Dominant language
TypeScript
Stars
1.5k
Forks
228
Avg merge
1d 14h
Merged PRs (30d)
48

Description

Describe the bug
When running a web server via WSL only localhost works, 127.0.0.1 does not reach the ports opened by WSL apps. The link generated by preview-docs uses http://127.0.0.1:8080 but for WSL users this should be http://localhost:8080.

To Reproduce
Run openapi preview-docs via Node installed on Windows Subsystem for Linux and click the link: ERR_CONNECTION_REFUSED

Expected behavior
Clicking the link provided by the CLI opens the docs successfully.

openapi-cli Version(s)
1.0.0-beta-69

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the preview-docs command and locate where the CLI generates the local documentation URL. Change the generated host from 127.0.0.1 to localhost, then run the preview-docs flow under WSL and confirm the link opens the docs successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.