Skip to content

wp-now:Use localhost instead of 127.0.0.1 #455

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

Merged
merged 1 commit into from
May 30, 2023

Conversation

t-hamano
Copy link
Contributor

See this comment.

What?

This PR changes the URL that wp-now listens on from 127.0.0.1 to localhost.

Why?

When I run wp-now start in WSL (a Windows virtual environment), it listens on 127.0.0.1 (ipv4 address).
However, when I access the URL on the host OS, it resolves to::1 (ipv6 address), so I believe this is why the server is unreachable.

Testing Instructions

  • run nx preview wp-now start
  • Confirm that the console displays the expected logs: Server running at http://localhost:8881/
  • Confirm that the WordPress site is displayed when accessing http://localhost:8881/.
  • Conform that WordPress Address and Site Address settings are http://localhost:8881/.
  • Confirm that all resources such as CSS and JS are also loaded at this URL and that no errors are output to the console.

Copy link
Collaborator

@adamziel adamziel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay, thank you @t-hamano! This looks good to me – let me also loop in @danielbachhuber and @sejas who are maintaining wp-now. A regression test would be fantastic to have here, but I can't think of a good way to add one.

Copy link
Member

@danielbachhuber danielbachhuber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

localhost works fine for me too. Thanks @t-hamano !

@danielbachhuber
Copy link
Member

@adamziel Do you want to land this and tag a new release before #477?

I imagine there will be some level of effort setting up a new release process for #477, which could take some time, and this would be a nice fix to get in users' hands.

@adamziel
Copy link
Collaborator

This is awesome @t-hamano, thank you!

@adamziel adamziel merged commit 73122f4 into WordPress:trunk May 30, 2023
@t-hamano t-hamano deleted the wp-now/use-localhost branch May 31, 2023 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants