Skip to content

How to expose 'host' for external device display? #3396

Answered by patak-dev
saurabhsri108 asked this question in Q&A
Discussion options

You must be logged in to vote

The default host now listens to 127.0.0.1 so you only get localhost exposure. It was changed because it is a security concern to expose your file system to external addresses by default.
To get the same behaviour as in v2.2, you can use:

vite --host

Or set server.host to true in your config.
https://vitejs.dev/config/#server-host

Replies: 18 comments 50 replies

Comment options

You must be logged in to vote
17 replies
@tusqasi
Comment options

@Mtillmann
Comment options

@SilasRodrigues19
Comment options

@Sigmakib2
Comment options

@andrewnash-icondirect
Comment options

Answer selected by Shinigami92
Comment options

You must be logged in to vote
15 replies
@Velkan33
Comment options

@BakerLees
Comment options

@Kayeddy
Comment options

@GillyRabutTsurwa
Comment options

@noszczykmichal
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@yhoungdev
Comment options

@ferares
Comment options

@cristian-araujo
Comment options

@ferares
Comment options

@BenedictLang
Comment options

Comment options

You must be logged in to vote
2 replies
@Mtillmann
Comment options

@rustyxlol
Comment options

Comment options

You must be logged in to vote
1 reply
@Noibisjunior
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@Mtillmann
Comment options

@Jessuhh
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@jcamiloguz
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@kumarvivek06071999
Comment options

@TaggartMaher
Comment options

@LEstradioto
Comment options

Comment options

You must be logged in to vote
1 reply
@RoachLin
Comment options

Comment options

You must be logged in to vote
1 reply
@ismaeleamsi83
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet