How does webpack-dev-server solve cross-domain requests! !

  node.js, question

1. LoaclHost: 8080 Web Pack-Dev-Server Local Server, the interface request address is, and now it is impossible to request the interface on the remote server locally.

XMLHttpRequest cannot load
 No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 403.

I have looked for relevant information. Is it wrong or what doesn’t work if the configuration is not made?

 devServer: {
 hot: true,
 inline: true,
 proxy: {
 '*': {
 target: 'localhost:8080',
 secure: false,
changeOrigin: true

ThenChange to your local reference address, such as /api/
When calling from other places, write ajax(‘/api/xxx’), etc