We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 520d84e commit c35e100Copy full SHA for c35e100
packages/vite/src/node/server/middlewares/proxy.ts
@@ -47,6 +47,10 @@ export function proxyMiddleware(
47
}
48
const proxy = httpProxy.createProxyServer(opts) as HttpProxy.Server
49
50
+ if (opts.configure) {
51
+ opts.configure(proxy, opts)
52
+ }
53
+
54
proxy.on('error', (err, req, originalRes) => {
55
// When it is ws proxy, res is net.Socket
56
const res = originalRes as http.ServerResponse | net.Socket
@@ -75,10 +79,6 @@ export function proxyMiddleware(
75
79
res.end()
76
80
77
81
})
78
-
- if (opts.configure) {
- opts.configure(proxy, opts)
- }
82
// clone before saving because http-proxy mutates the options
83
proxies[context] = [proxy, { ...opts }]
84
0 commit comments