From 431b32a758ce5c33c987c36e4ba74795f7fe3a64 Mon Sep 17 00:00:00 2001 From: hemildesai Date: Thu, 6 Aug 2020 11:54:18 +0530 Subject: [PATCH] Fix intermittent connection issues between web and api in devServer --- packages/core/config/webpack.development.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/core/config/webpack.development.js b/packages/core/config/webpack.development.js index 43383c6fbb6e..acd16e6306ed 100644 --- a/packages/core/config/webpack.development.js +++ b/packages/core/config/webpack.development.js @@ -20,10 +20,13 @@ const baseConfig = merge(webpackConfig('development'), { port: redwoodConfig.web.port, proxy: { [redwoodConfig.web.apiProxyPath]: { - target: `http://localhost:${redwoodConfig.api.port}`, + target: `http://[::1]:${redwoodConfig.api.port}`, pathRewrite: { [`^${escapeRegExp(redwoodConfig.web.apiProxyPath)}`]: '', }, + headers: { + Connection: 'keep-alive', + }, }, }, inline: true,