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

ERR_UNEXPECTED_PROXY_AUTH in chrome #16

Open
raDiesle opened this Issue Jun 27, 2016 · 4 comments

Comments

Projects
None yet
2 participants
@raDiesle
Copy link

raDiesle commented Jun 27, 2016

I am using it in combination with http-proxy-middleware
but getting ERR_UNEXPECTED_PROXY_AUTH in crhome network console.

any idea how to fix it? I tried multiple variations.

@TooTallNate

This comment has been minimized.

Copy link
Owner

TooTallNate commented Jun 27, 2016

You're trying to use this module in Chrome? I'm not sure I understand. This module implements the http.Agent interface for usage with Node.js' http.Client http request interface.

@raDiesle

This comment has been minimized.

Copy link
Author

raDiesle commented Jun 27, 2016

browser sync provides me the webserver, which I open an index.html in browser.
in index.html, AJAX calls are done, which I like to proxy on the webserver,
because server-side disable of cors is a security problem, but needed for development.

@TooTallNate

This comment has been minimized.

Copy link
Owner

TooTallNate commented Jun 27, 2016

You're gonna have to show me some example code because I'm still not following.

@raDiesle

This comment has been minimized.

Copy link
Author

raDiesle commented Jun 28, 2016

here is the full code:

gulp.task(CONFIG.GULP.DEV_WEBSERVER, function () {
        plugins.browserSync = plugins.browserSync || require(CONFIG.GULP.BROWSER_SYNC);
        plugins.HttpsProxyAgent = require('https-proxy-agent');
        plugins.proxy = plugins.proxy || require("http-proxy-middleware");


        var jsonPlaceholderProxy = plugins.proxy(
            "/etc",

            {
                target : "https://int-dev.cz",
                agent: new plugins.HttpsProxyAgent( {host : "proxy.corp.dir", port : "8080", secureProxy : true}),
                logLevel: 'debug',
               changeOrigin: true, 
            }

        );

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

        plugins.browserSync.init({
            server: {
                baseDir: CONFIG.DEV.WEBSERVER_BASE_ROOT_DIRS()
                ,
                  middleware: [jsonPlaceholderProxy],
            },
            startPath: CONFIG.DEV.WEBSERVER_STARTPATH(),
            port: 3000,
             https: true,

        });
    });

Seems like problem is also described here: http-auth/http-auth#24

Maybe you have an idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment