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

fix: serve on ipv4 #196

Merged
merged 1 commit into from
Dec 3, 2024
Merged

Conversation

nicotu01
Copy link
Contributor

@nicotu01 nicotu01 commented Nov 26, 2024

Fix #194

@nicotu01 nicotu01 changed the title (fix) serve on ipv4 fix: serve on ipv4 Nov 26, 2024
@nicotu01
Copy link
Contributor Author

Hi !
Playwright tests are broken.
I'm not that it is due to my code. I've the error on main branch

@gioboa
Copy link
Collaborator

gioboa commented Nov 28, 2024

Hi ! Playwright tests are broken. I'm not that it is due to my code. I've the error on main branch

Tests are working fine on the main branch
https://github.com/module-federation/vite/actions/runs/12031796417/job/33621509041

@nicotu01
Copy link
Contributor Author

Hi @gioboa
Sorry, I wasn't running the right example project for testing. Now it works fine on my computer. Can you run the checks again, please?

@nicotu01 nicotu01 force-pushed the fix/serve-host-ipv4 branch from cf7c4ac to 0eea33a Compare November 30, 2024 05:56
@nicotu01
Copy link
Contributor Author

nicotu01 commented Dec 2, 2024

Hi @gioboa
All checks have passed.
Is it ok for you ?

@gioboa
Copy link
Collaborator

gioboa commented Dec 2, 2024

Hi @gioboa All checks have passed. Is it ok for you ?

It looks great to me, why we are doing a special check for 0.0.0.0 ?

@nicotu01
Copy link
Contributor Author

nicotu01 commented Dec 3, 2024

Hi @gioboa
The Vite option server.host can be a string or boolean.
Here are the possible values :

  • (by default) : it listen on localhost
  • false : it listen on localhost
  • true (= 0.0.0.0 ) : it listen on all addresses, including localhost in serve context
  • 0.0.0.0 : it listen on all addresses, including localhost in serve context
  • ${ip address} : it listen on ${ip address}

In IPv4, the address 0.0.0.0 is a non-routable meta-address used to designate an invalid, unknown, or unreachable destination.
So, it is better to configure the default routable host in this case.

Copy link
Collaborator

@gioboa gioboa left a comment

Choose a reason for hiding this comment

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

Thanks @nicotu01 for your help and your exhaustive explanation
Kudos for your first PR in this project 👏

@gioboa gioboa merged commit b377cc0 into module-federation:main Dec 3, 2024
4 checks passed
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.

Cannot serve application on host 127.0.0.1 with shared options
2 participants