A vite plugin server and build your.user.js for userscript engine like Tampermonkey, Violentmonkey, Greasemonkey, ScriptCat
1.24k
stars
65
forks
source link
`vite --host 0.0.0.0` is not working, due to host 0.0.0.0 is replaced into 127.0.0.1, and why? #116
Closed
snomiao closed 7 months ago
I am running vite inside docker so I need to proxy the vite port from another http service.
version 3.5.0 • Public • Published 4 months ago
Current:
vite --host
-- not working ❌, will listen to 127.0.0.1vite --host 0.0.0.0
-- not working ❌, will listen to 127.0.0.1vite --host 172.21.0.5
-- it works ✅Expected:
vite --host
-- works ✅vite --host 0.0.0.0
-- works ✅vite --host 172.21.0.5
-- it works ✅Possible Reason
vite --host 0.0.0.0
is not workingAnd that is because of this file:
when getting --host args, '0.0.0.0' or true is replaced with '127.0.0.1'
Workaround for host on LAN
run ifconfig and got the IP address from docker, then pass it into --host argument.
vite --host 172.21.0.5
-- it works ✅