Skip to content

Commit c9f4112

Browse files
committed
fix: caddy return 502 when vite only serve on localhost
1 parent f740f3d commit c9f4112

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/caddy/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export class CaddyInstant {
164164
* @returns
165165
*/
166166
async run(source: string, target: string, options?: Partial<RunOptions>) {
167-
source = source.replace('0.0.0.0', '127.0.0.1').replace('localhost', '127.0.0.1')
167+
source = source.replace('0.0.0.0', '127.0.0.1')
168168
const {
169169
restore = true,
170170
base = '/',

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export const unpluginFactory: UnpluginFactory<Options> = options => ({
138138
// })
139139

140140
const devServer = {
141-
host: '127.0.0.1',
141+
host: 'localhost',
142142
port: 8080,
143143
...compiler.options.devServer,
144144
// @ts-expect-error vuecli

0 commit comments

Comments
 (0)