Gulp Browsersync And Http-proxy-middleware In Offline Mode
Solution 1:
Just did some tests and I can confirm this issue. Ran the library tests with: "npm test". It will setup actual servers to run some of the tests.
When online, all tests succeed. But when running the tests offline, it will produce the same error message.
The actual proxy functionality is provided by node-http-proxy.
This issue has been reported at: https://github.com/nodejitsu/node-http-proxy/issues/835
I'm also curious why http-proxy can't be used offline.
(disclaimer: I'm the author of http-proxy-middleware.)
Solution 2:
Looks like core browsersync doesn't require an internet connection. Some features do.
The following setting lets you switch browsersync to offline mode: https://browsersync.io/docs/options/#option-online
I set this property in the server.js file and my app works off line:
browserSync.instance = browserSync.init({
startPath: '/',
server: server,
browser: browser,
online: false
});
Post a Comment for "Gulp Browsersync And Http-proxy-middleware In Offline Mode"