question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Proxy not working

See original GitHub issue

Issue details

Proxy never connects…

Starting a simple rack based web server running on port 9292, then try to proxy it

var browserSync = require('browser-sync').create();

gulp.task('browser-sync', function() {
  browserSync.init({
    proxy: 'http://localhost:9292',
    port: 4000
  });
});

$ gulp browser-sync pops open a new window but it just hangs…

Browsersync 2.14.0 Node v6.3.1 OS X 10.11.5

http://stackoverflow.com/questions/38755795/browser-sync-proxy-fails-to-connect

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:4
  • Comments:5

github_iconTop GitHub Comments

1reaction
browniebrokecommented, Dec 10, 2021

I have a simialr problem with the latest version of Browsersync and I noticed that it works when the host of the target is different 🤔

Before (not working):

browserSync.init({
  proxy: 'localhost:8000'
})

After (seems to work):

browserSync.init({
  proxy:  {
    target: '127.0.0.1:8000',
    proxyReq: [
      function(proxyReq, req) {
        // Assign proxy "host" header same as current request at Browsersync server
        proxyReq.setHeader('Host', req.headers.host)
      }
    ]
  },
})
1reaction
thymikeecommented, Aug 16, 2016

Having the same issue with browser-sync@2.14. Can confirm it works as expected in browser-sync@2.13 so the new version must have introduced some regression (tested on Node v6.3.1 and v5.11.1).

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix “There Is Something Wrong With the Proxy Server ...
Go to the Control Panel. · Click on Internet Options. · Click on LAN (Local Area Network) Settings. · Uncheck the box that...
Read more >
FIX: Unable to Connect to proxy server in Windows 10/11
How can I fix Unable to connect to proxy server? · 1. Reset Internet options · 2. Disable proxy · 3. Use a...
Read more >
Guide to Solving Proxy Status Errors - Oxylabs
How to fix: Fixing this issue is simple. You need to update your proxy server settings by including whitelisted IPs and use appropriate ......
Read more >
Is Your Proxy Not Working? (Troubleshooting Solutions)
How do I know if a proxy is working? · Website bans · Wrong kind of proxy · Your proxy service is down...
Read more >
proxy server not responding - Microsoft Community
proxy server not responding · Check your proxy settings. Go to Tools > Internet Options > Connections. If you are on a LAN,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found