Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browsersync client script not injected when proxying through Cloudflare Zero Trust #1988

Open
2 of 10 tasks
husterk opened this issue Dec 1, 2022 · 2 comments
Open
2 of 10 tasks

Comments

@husterk
Copy link

husterk commented Dec 1, 2022

Issue details

I have a local development website (e.g. http://localhost:2368) that is proxied through a Cloudflare Zero Trust tunnel (e.g. https://my-proxied-site.com). When I set up browsersync (proxy mode) to target the http://localhost:2368 site directly then everything works and the browser instances are registered with browsersync. However, when I set up browsersync (proxy mode) to target the Cloudflare proxied site at https://my-proxied-site.com then the browser instances fail to connect to browsersync. Upon inspection, I do not see the necessary browsersync scripts being injected into the site.

I have attempted to implement a bypass rule for all traffic to my-proxied-site.com to ensure that the Cloudflare gateway policies aren't blocking any connection attempts. However, this did not help.

Steps to reproduce/test case

See notes above.

Please specify which version of Browsersync, node and npm you're running

  • Browsersync [ 2.27.10 ]
  • Node [ 16.3.0 ]
  • Npm [ 8.1.0 ]

Affected platforms

  • linux
  • windows
  • OS X
  • freebsd
  • solaris
  • other (please specify which)

Browsersync use-case

  • API
  • Gulp
  • Grunt
  • CLI

If CLI, please paste the entire command below

None

for all other use-cases, (gulp, grunt etc), please show us exactly how you're using Browsersync

import { create as createBrowserSync } from "browser-sync";

const browserSync = createBrowserSync();

browserSync.init({
        proxy: {
            target: "https://my-proxied-site.com",  // THIS DOES NOT WORK
            //target: "http://localhost:2368",           // THIS WORKS
        },
        port: 8443,
        open: false,
        logLevel: "debug",
        logConnections: true,
    });
@shakyShane
Copy link
Contributor

Quick question - does the site in question have a 'body' tag?

@husterk
Copy link
Author

husterk commented Dec 19, 2022

Quick question - does the site in question have a 'body' tag?

Yes, it does have a <body></body> tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants