动态站点所需的 Browsersync 代理设置是什么,我正在尝试 运行 我的 app.js 文件,但页面超时

What are the Browsersync proxy settings needed for a dynamic site, i'm trying to run my app.js file but the page times out

    var bSync = done => {
        browserSync.init({

            proxy: {
                target: "localhost:" + 3000 + "/"
            },
            files: ['app.js'],

我之前尝试过的设置

            // injectChanges: true,
            // proxy: '127.0.0.1:3000/',
            // host: 'localhost',
            // port: 3000
        });
        done();
    };

我怎样才能让它工作 - 有什么想法吗?我基本上想设置一个 gulp 文件,允许我启动我的快速服务器,然后是路由和 ejs 文件

我终于让它像这样工作了。端口和代理是相同的,但是通过将端口切换到 3003 它可以正常工作。隧道意味着我可以在生产中连接其他设备,例如我的 phone,以查看布局等,这非常有用。

const bSync = () => {
    browserSync.init({
        proxy: 'localhost:3000',
        port: 3003,
        online: true,
        tunnel: true
    });
};