proxy not working with gulp
See original GitHub issueWhen I run browser-sync with gulp it says it is proxying my server but it launches my site on the the same port. However when I manually start browser-sync, I get the expected behavior.
Here is my gupfile
var gulp = require('gulp'),
browserSync = require('browser-sync'),
reload = browserSync.reload;
var watchFiles = ['./views/**/*', './public/**/*'];
gulp.task('browser-sync', function() {
browserSync.init(null, {
proxy: "localhost:3000"
});
});
gulp.task('watch', ['browser-sync'], function () {
gulp.watch(watchFiles, reload);
});
gulp.task('default', ['watch']);
Issue Analytics
- State:
- Created 9 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Proxy URL not working with BrowserSync Gulp task
Can someone tell me why my proxy URL isn't working with BrowserSync and Gulp? Instead, it just keeps using http://localhost:3000 as the dev ......
Read more >http-proxy-middleware - npm
Configure proxy middleware with ease for connect, express, browser-sync and many more. Powered by the popular Nodejitsu http-proxy . GitHub ...
Read more >How to resolve NPM proxy issue whilel running node JS ...
'https://registry.npmjs.com/nodemon' is not a proxy, it is the target ... Then try to run your npm install command and it should work.
Read more >How do I wire up Browsersync and Gulp in my Lando app?
# Configuring Lando for Browsersync · # Create the proxy · # Stream changes whenever Lando is running.
Read more >Gulp Watch / BrowserSync Proxy not using port 3000 - sage
The EACCES error is a bit easier to fix. You most likely have some messed up permissions after running node / bower etc...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I recently had the same issue and in my case, I found out that my application is running at port 3000. same port for browser-sync by default
@makenova I noticed that your proxy is
localhost:3000
, try the following config to specify a different port for browser-sync to use@makenova - BrowserSync just checks for an available port at run time, so it sounds like it’s losing in a race condition.
This is exactly what the
port
option is for, thanks to @sogko for pointing that out😃