File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ const previewPort = Number(process.env.MUX_VITE_PREVIEW_PORT ?? "4173");
1717// Allow localhost, 127.0.0.1, and all *.coder domains
1818// When host is 0.0.0.0, allow all hosts for remote access
1919const allowedHosts = devServerHost === "0.0.0.0"
20- ? "all"
20+ ? [ "localhost" , "127.0.0.1" , "mux.coder" , ".coder" ]
2121 : [ "localhost" , "127.0.0.1" , ".coder" ] ;
2222
2323const alias : Record < string , string > = {
@@ -125,8 +125,10 @@ export default defineConfig(({ mode }) => ({
125125 } ,
126126 hmr : {
127127 // Configure HMR to use the correct host for remote access
128- host : devServerHost ,
129- port : devServerPort ,
128+ // When server binds to 0.0.0.0, clients should connect via their actual hostname
129+ // Use clientPort to ensure HMR connects through the right port
130+ host : devServerHost === "0.0.0.0" ? undefined : devServerHost ,
131+ clientPort : devServerPort ,
130132 protocol : "ws" ,
131133 } ,
132134 } ,
You can’t perform that action at this time.
0 commit comments