Browsersync LiveReload on Proxy Server

815 views Asked by At

I am new to browser-sync and I can't seem to figure out how to get live reload to work on a proxy server. In my current setup I don't have access to the files on my local machine so I have to use a proxy. I currently have a config file and here is the current setup.

module.exports = {
"ui": {
    "port": 3001,
    "weinre": {
        "port": 8080
    }
},
"files": ['Styles/bootstrap-custom-addons.css', '/Styles/*.css'],
"watchOptions": {},
"server": false,
"proxy": {
    target: "http://example.com",
    files: ['Styles/bootstrap-custom-addons.css', '/Styles/*.css'],
},
"port": 3000,
"middleware": false,
"ghostMode": {
    "clicks": true,
    "scroll": true,
    "forms": {
        "submit": true,
        "inputs": true,
        "toggles": true
    }
},
"logLevel": "info",
"logPrefix": "BS",
"logConnections": false,
"logFileChanges": true,
"logSnippet": true,
"rewriteRules": false,
"open": "local",
"browser": "default",
"xip": false,
"hostnameSuffix": false,
"reloadOnRestart": true,
"notify": true,
"scrollProportionally": true,
"scrollThrottle": 0,
"reloadDelay": 0,
"reloadDebounce": 0,
"plugins": [],
"injectChanges": true,
"startPath": null,
"minify": true,
"host": null,
"codeSync": true,
"timestamps": true,
"clientEvents": [
    "scroll",
    "input:text",
    "input:toggles",
    "form:submit",
    "form:reset",
    "click"
],
"socket": {
    "path": "/browser-sync/socket.io",
    "clientPath": "/browser-sync",
    "namespace": "/browser-sync",
    "clients": {
        "heartbeatTimeout": 5000
    }
},
"tagNames": {
    "less": "link",
    "scss": "link",
    "css": "link",
    "jpg": "img",
    "jpeg": "img",
    "png": "img",
    "svg": "img",
    "gif": "img",
    "js": "script"
}

};

Page Scroll and clicks work across browsers, but when I update a file on the server it does not automatically reload the page, am I not setting up the config file correctly? Also what is the difference between running browser-sync start --config bs-config.js and just running brower-sync start --proxy "http://www.example.com"?

0

There are 0 answers