这是我的webpack-dev-server配置:
devServer: {
contentBase: path.join(__dirname, 'dist'),
port: 3000,
hot: false,
inline: false,
historyApiFallback: true,
proxy: [
{
path: 'ws://',
target: 'ws://localhost:9000',
ws: true,
secure: false,
},
{
path: '/',
target: 'http://localhost:9000',
secure: false,
changeOrigin: true,
},
]
},
问题是,ws请求引发了这个错误:
WebSocket connection to 'ws://api2/someSocket' failed: Error in connection establishment: net::ERR_NAME_NOT_RESOLVED
我的配置有什么问题?