grunt-connect-proxy icon indicating copy to clipboard operation
grunt-connect-proxy copied to clipboard

Proxy error: ECONNRESET while proxying https to https

Open drudkiewicz opened this issue 8 years ago • 5 comments

I'm forwarding HTTPS to HTTPS on 2 different ports. I tried saying https:true and secure:false with no luck as well. There is no breaking change stated in the changelog for those versions.

Using version 0.1.10 the following configuration works Using any newer version is broken with Proxy error

connect: {
      options: {
        port: process.env.PORT || 9001,
        hostname: process.env.HOSTNAME || '0.0.0.0',
        livereload: 35730,
        protocol: 'https'
      },
      proxies: [
        {
          context: '/api',
          host: process.env.PROXY_HOST || '0.0.0.0',
          port: process.env.PROXY_PORT || 9000,
          ws: true
        },
}

drudkiewicz avatar Jun 28 '16 11:06 drudkiewicz

I am seeing a similar connection reset message when proxying http to https. However, this is fixed by forcing the github version rather than the npm version: npm install git+https://github.com/drewzboto/grunt-connect-proxy.git --save-dev

jhubble avatar Jul 13 '16 03:07 jhubble

Same. npm install git+https://github.com/drewzboto/grunt-connect-proxy.git --save-dev Fixed it for me too.

brian-slate avatar Jul 18 '16 18:07 brian-slate

I have similar error message after upgrade grunt-connect-proxy from 0.1.10 to 0.2.0 My Gruntfile.js setting as following:

    // The actual grunt server settings
    connect: {
      proxies: [
        {
          context: '/api',
          host: '127.0.0.1',
          port: 5001,
          https: true,
          protocol: 'https',
          changeOrigin: false
        },
        {
          context: '/repository',
          host: '127.0.0.1',
          port: 5000,
          https: false,
          changeOrigin: false
        }
      ],
      options: {
        port: 9000,
        hostname: '0.0.0.0',
        livereload: 35729
      },
      livereload: {
        options: {
          open: false,
          base: [
            '.tmp',
            '<%= yeoman.app %>'
          ],
          port: 9000,
          middleware: function (connect) {
            return [
              proxySnippet,
              serveStatic(require('path').resolve('app'))
            ];
          }
        }
      },
      test: {
        options: {
          port: 9001,
          base: [
            '.tmp',
            'test',
            '<%= yeoman.app %>'
          ]
        }
      },
      dist: {
        options: {
          base: '<%= yeoman.dist %>'
        }
      }
    },

How can I fix this issue?

linlinlinlin avatar Jul 25 '16 02:07 linlinlinlin

Same issue here.

zbindenren avatar Mar 27 '17 08:03 zbindenren

Same for me. npm install git+https://github.com/drewzboto/grunt-connect-proxy.git --save-dev fixed the issue.

It would be great if the NPM version too was working as the git one

heppy83 avatar Jul 07 '17 09:07 heppy83