Flask应用程序正在提供代理错误:ENOTFOUND

Flask应用程序正在提供代理错误:ENOTFOUND,flask,gruntjs,Flask,Gruntjs,正在尝试运行使用grunt的Flask项目 GrunFile.js具有以下配置: connect: { options: { port: 9000, // Change this to '0.0.0.0' to access the server from outside. //hostname: 'localhost', hostname: '0.0.0.0',

正在尝试运行使用grunt的Flask项目

GrunFile.js具有以下配置:

connect: {
        options: {
            port: 9000,
            // Change this to '0.0.0.0' to access the server from outside.
            //hostname: 'localhost',
            hostname: '0.0.0.0',
            livereload: 35728
        },
        proxies: [{
            context: '/api',
            host: 'backend',
            port: 5000,
            changeOrigin: true
        }],
.constant('serverURL', 'http://127.0.0.1:9000/api');
app.py具有以下功能:

app.run(host='127.0.0.1', port='9000', debug=True) #host='0.0.0.0'
ServerURL具有以下配置:

connect: {
        options: {
            port: 9000,
            // Change this to '0.0.0.0' to access the server from outside.
            //hostname: 'localhost',
            hostname: '0.0.0.0',
            livereload: 35728
        },
        proxies: [{
            context: '/api',
            host: 'backend',
            port: 5000,
            changeOrigin: true
        }],
.constant('serverURL', 'http://127.0.0.1:9000/api');
客户端显示:

Started connect web server on http://0.0.0.0:9000
但在客户端窗口中,我收到以下信息:

Running "watch" task
Waiting...
>> Proxy error:  ENOTFOUND
>> Proxy error:  ENOTFOUND

有人能告诉我这背后的原因吗?

在代理中,尝试将主机从后端更改为0.0.0.0