bjowes / cypress-ntlm-auth

Windows authentication plugin for Cypress
MIT License
55 stars 10 forks source link

"npx cypress-ntlm open" Cypress is not loading #245

Closed EEO27 closed 6 months ago

EEO27 commented 8 months ago

I am using the cypress-ntlm-auth plugin with cypress (behind a corporate proxy) but got the following issue:

"NPM Cypress Open" works perfect. Cypress is opening and I can run my tests.

"npx cypress-ntlm run" works also perfect I can confirm that the ntlm connection is authorized.

But when I try "npx cypress-ntlm open" cypress is trying to start and it goes not further than the spinning CY logo. Node v21.6.0 npm v10.3.0 Cypress 13.6.3 (also tried with 13.4.0)

enter image description here

LOGS:

PS C:\Git\xx\ClientApp> npx cypress-ntlm open
      cypress:plugin:ntlm-auth Adding localhost to NO_PROXY to disable localhost proxying +0ms
      cypress:plugin:ntlm-auth Adding 127.0.0.1 to NO_PROXY to disable loopback proxying +1ms 
      cypress:plugin:ntlm-auth Starting ntlm-proxy... +0ms
      cypress:plugin:ntlm-auth NTLM auth config API listening on: http://127.0.0.1:54263 +10ms
      cypress:plugin:ntlm-auth NTLM auth proxy listening on : http://127.0.0.1:54264 +15ms
      cypress:plugin:ntlm-auth Startup done! +0ms
      cypress:plugin:ntlm-auth {
      cypress:plugin:ntlm-auth   configApiUrl: 'http://127.0.0.1:54263',
      cypress:plugin:ntlm-auth   ntlmProxyUrl: 'http://127.0.0.1:54264'
      cypress:plugin:ntlm-auth } +0ms
      cypress:plugin:ntlm-auth Opening Cypress... +3ms

    DevTools listening on ws://127.0.0.1:54265/devtools/browser/5c6b6e7b-5df2-4561-a413-af9a686bff6b
      cypress:plugin:ntlm-auth getTargetHost - host header  localhost:54266 +1s
      cypress:plugin:ntlm-auth Created agent for client 127.0.0.1:54267 to target http://localhost:54266/ +18ms
      cypress:plugin:ntlm-auth Request to http://localhost:54266/ - pass on +12ms
      cypress:plugin:ntlm-auth getTargetHost - host header  localhost:54266 +368ms
      cypress:plugin:ntlm-auth getTargetHost - host header  localhost:54266 +231ms
      cypress:plugin:ntlm-auth Request to http://localhost:54266/ - pass on +23ms
      cypress:plugin:ntlm-auth getTargetHost - host header  localhost:54266 +3ms
      cypress:plugin:ntlm-auth Created agent for client 127.0.0.1:54269 to target http://localhost:54266/ +73ms
      cypress:plugin:ntlm-auth Request to http://localhost:54266/ - pass on +52ms
      cypress:plugin:ntlm-auth getTargetHost - host header  localhost:54266 +58ms
      cypress:plugin:ntlm-auth getTargetHost - host header  localhost:54266 +84ms
      cypress:plugin:ntlm-auth Tunnel to localhost:54266 +755ms
      cypress:plugin:ntlm-auth getTargetHost - host header  localhost:54266 +28ms
      cypress:plugin:ntlm-auth Request to http://localhost:54266/ - pass on +0ms
      cypress:plugin:ntlm-auth getTargetHost - host header  localhost:54266 +4ms
      cypress:plugin:ntlm-auth Tunnel to localhost:54266 +25ms
      cypress:plugin:ntlm-auth getTargetHost - host header  localhost:54266 +4ms
      cypress:plugin:ntlm-auth Request to http://localhost:54266/ - pass on +0ms
      cypress:plugin:ntlm-auth getTargetHost - host header  registry.npmjs.org:80 +829ms
      cypress:plugin:ntlm-auth Created agent for client 127.0.0.1:54277 to target https://registry.npmjs.org:80/ +3ms
      cypress:plugin:ntlm-auth Request to https://registry.npmjs.org:80/ - pass on +0ms
      cypress:plugin:ntlm-auth:tunnelagent [0]: tunneling socket could not be established, statusCode=403 +0ms
      cypress:plugin:ntlm-auth getTargetHost - host header  download.cypress.io:80 +361ms
      cypress:plugin:ntlm-auth Created agent for client 127.0.0.1:54281 to target https://download.cypress.io:80/ +9ms
      cypress:plugin:ntlm-auth Request to https://download.cypress.io:80/ - pass on +7ms
      cypress:plugin:ntlm-auth:tunnelagent [1]: tunneling socket could not be established, statusCode=403 +60ms
    "npx cypress-ntlm open"  cypress:plugin:ntlm-auth getTargetHost - host header  localhost:54266 +2s
      cypress:plugin:ntlm-auth Removed agent for 127.0.0.1:54267 due to socket.close +2s
      cypress:plugin:ntlm-auth getTargetHost - host header  localhost:54266 +991ms
      cypress:plugin:ntlm-auth Request to http://localhost:54266/ - pass on +0ms
    cypress-ntlm-auth: Certificate validation failed for "download.cypress.io:80". ETIMEDOUT
      cypress:plugin:ntlm-auth WARN: Certificate validation failed for "download.cypress.io:80". AggregateError [ETIMEDOUT]: 
        at internalConnectMultiple (node:net:1116:18)
        at afterConnectMultiple (node:net:1680:7) {
      code: 'ETIMEDOUT',
      [errors]: [
        Error: connect ETIMEDOUT 104.22.11.239:80
            at createConnectionError (node:net:1643:14)
            at Timeout.internalConnectMultipleTimeout (node:net:1702:38)
            at listOnTimeout (node:internal/timers:575:11)
            at process.processTimers (node:internal/timers:514:7) {
          errno: -4039,
          code: 'ETIMEDOUT',
          syscall: 'connect',
          address: '104.22.11.239',
          port: 80
        },
        Error: connect ETIMEDOUT 104.22.10.239:80
            at createConnectionError (node:net:1643:14)
            at Timeout.internalConnectMultipleTimeout (node:net:1702:38)
            at listOnTimeout (node:internal/timers:575:11)
            at process.processTimers (node:internal/timers:514:7) {
          errno: -4039,
          code: 'ETIMEDOUT',
          syscall: 'connect',
          address: '104.22.10.239',
          port: 80
        },
        Error: connect ETIMEDOUT 172.67.25.250:80
            at createConnectionError (node:net:1643:14)
            at afterConnectMultiple (node:net:1673:16) {
          errno: -4039,
          code: 'ETIMEDOUT',
          syscall: 'connect',
          address: '172.67.25.250',
          port: 80
        }
      ]
    } +17s
    cypress-ntlm-auth: Certificate validation failed for "registry.npmjs.org:80". ETIMEDOUT
      cypress:plugin:ntlm-auth WARN: Certificate validation failed for "registry.npmjs.org:80". AggregateError [ETIMEDOUT]: 
        at internalConnectMultiple (node:net:1116:18)
        at afterConnectMultiple (node:net:1680:7) {
      code: 'ETIMEDOUT',
      [errors]: [
        Error: connect ETIMEDOUT 104.16.27.34:80
            at createConnectionError (node:net:1643:14)
            at Timeout.internalConnectMultipleTimeout (node:net:1702:38)
            at listOnTimeout (node:internal/timers:575:11)
            at process.processTimers (node:internal/timers:514:7) {
          errno: -4039,
          code: 'ETIMEDOUT',
          syscall: 'connect',
          address: '104.16.27.34',
          port: 80
        },
        Error: connect ETIMEDOUT 104.16.0.35:80
            at createConnectionError (node:net:1643:14)
            at Timeout.internalConnectMultipleTimeout (node:net:1702:38)
            at listOnTimeout (node:internal/timers:575:11)
            at process.processTimers (node:internal/timers:514:7) {
          errno: -4039,
          code: 'ETIMEDOUT',
          syscall: 'connect',
          address: '104.16.0.35',
          port: 80
        },
        Error: connect ETIMEDOUT 104.16.30.34:80
            at createConnectionError (node:net:1643:14)
            at Timeout.internalConnectMultipleTimeout (node:net:1702:38)
            at listOnTimeout (node:internal/timers:575:11)
            at process.processTimers (node:internal/timers:514:7) {
          errno: -4039,
          code: 'ETIMEDOUT',
          syscall: 'connect',
          address: '104.16.30.34',
          port: 80
        },
        Error: connect ETIMEDOUT 104.16.24.34:80
            at createConnectionError (node:net:1643:14)
            at Timeout.internalConnectMultipleTimeout (node:net:1702:38)
            at listOnTimeout (node:internal/timers:575:11)
            at process.processTimers (node:internal/timers:514:7) {
          errno: -4039,
          code: 'ETIMEDOUT',
          syscall: 'connect',
          address: '104.16.24.34',
          port: 80
        },
        Error: connect ETIMEDOUT 104.16.3.35:80
            at createConnectionError (node:net:1643:14)
            at Timeout.internalConnectMultipleTimeout (node:net:1702:38)
            at listOnTimeout (node:internal/timers:575:11)
            at process.processTimers (node:internal/timers:514:7) {
          errno: -4039,
          code: 'ETIMEDOUT',
          syscall: 'connect',
          address: '104.16.3.35',
          port: 80
        },
        Error: connect ETIMEDOUT 104.16.26.34:80
            at createConnectionError (node:net:1643:14)
            at Timeout.internalConnectMultipleTimeout (node:net:1702:38)
            at listOnTimeout (node:internal/timers:575:11)
            at process.processTimers (node:internal/timers:514:7) {
          errno: -4039,
          code: 'ETIMEDOUT',
          syscall: 'connect',
          address: '104.16.26.34',
          port: 80
        },
        Error: connect ETIMEDOUT 104.16.25.34:80
            at createConnectionError (node:net:1643:14)
            at Timeout.internalConnectMultipleTimeout (node:net:1702:38)
            at listOnTimeout (node:internal/timers:575:11)
            at process.processTimers (node:internal/timers:514:7) {
          errno: -4039,
          code: 'ETIMEDOUT',
          syscall: 'connect',
          address: '104.16.25.34',
          port: 80
        },
        Error: connect ETIMEDOUT 104.16.2.35:80
            at createConnectionError (node:net:1643:14)
            at Timeout.internalConnectMultipleTimeout (node:net:1702:38)
            at listOnTimeout (node:internal/timers:575:11)
            at process.processTimers (node:internal/timers:514:7) {
          errno: -4039,
          code: 'ETIMEDOUT',
          syscall: 'connect',
          address: '104.16.2.35',
          port: 80
        },
        Error: connect ETIMEDOUT 104.16.28.34:80
            at createConnectionError (node:net:1643:14)
            at Timeout.internalConnectMultipleTimeout (node:net:1702:38)
            at listOnTimeout (node:internal/timers:575:11)
            at process.processTimers (node:internal/timers:514:7) {
          errno: -4039,
          code: 'ETIMEDOUT',
          syscall: 'connect',
          address: '104.16.28.34',
          port: 80
        },
        Error: connect ETIMEDOUT 104.16.31.34:80
            at createConnectionError (node:net:1643:14)
            at Timeout.internalConnectMultipleTimeout (node:net:1702:38)
            at listOnTimeout (node:internal/timers:575:11)
            at process.processTimers (node:internal/timers:514:7) {
          errno: -4039,
          code: 'ETIMEDOUT',
          syscall: 'connect',
          address: '104.16.31.34',
          port: 80
        },
        Error: connect ETIMEDOUT 104.16.29.34:80
            at createConnectionError (node:net:1643:14)
            at Timeout.internalConnectMultipleTimeout (node:net:1702:38)
            at listOnTimeout (node:internal/timers:575:11)
            at process.processTimers (node:internal/timers:514:7) {
          errno: -4039,
          code: 'ETIMEDOUT',
          syscall: 'connect',
          address: '104.16.29.34',
          port: 80
        },
        Error: connect ETIMEDOUT 104.16.1.35:80
            at createConnectionError (node:net:1643:14)
            at afterConnectMultiple (node:net:1673:16) {
          errno: -4039,
          code: 'ETIMEDOUT',
          syscall: 'connect',
          address: '104.16.1.35',
          port: 80
        }
      ]
    } +2s
bjowes commented 8 months ago

My first hunch is that this is caused by a corporate proxy. Could it be the case that your site runs on the internal network and does not require external (internet) resources?

cypress open connects to several internet resources, you can see connection timeouts to download.cypress.io and others in the logs. It is possible that cypress fails to open due to this (which would be a bug in itself).

When running cypress without cypress-ntlm, it will do more to detect and configure a corporate proxy. That could explain why it works in that case. Check the proxy settings when cypress is opened, if they are not blank a corporate proxy is used. Then see the readme on how to configure cypress-ntlm for this scenario.

One concern is that I see 403 responses in the logs. This could mean that the corporate proxy requires authentication. This is not supported by cypress-ntlm. Last I checked it wasn’t supported by cypress either but that could have changed.

/Björn W

Skickat från min iPhone

ons 17 jan. 2024 kl. 06:16 skrev EEO27 @.***>:

I am using the cypress-ntlm-auth plugin with cypress (behind a corporate proxy) but got the following issue:

"NPM Cypress Open" works perfect. Cypress is opening and I can run my tests.

"npx cypress-ntlm run" works also perfect I can confirm that the ntlm connection is authorized.

But when I try "npx cypress-ntlm open" cypress is trying to start and it goes not further than the spinning CY logo.

[image: enter image description here] https://i.stack.imgur.com/NYSUV.png

LOGS:

PS C:\Git\xx\ClientApp> npx cypress-ntlm open cypress:plugin:ntlm-auth Adding localhost to NO_PROXY to disable localhost proxying +0ms cypress:plugin:ntlm-auth Adding 127.0.0.1 to NO_PROXY to disable loopback proxying +1ms cypress:plugin:ntlm-auth Starting ntlm-proxy... +0ms cypress:plugin:ntlm-auth NTLM auth config API listening on: http://127.0.0.1:54263 +10ms cypress:plugin:ntlm-auth NTLM auth proxy listening on : http://127.0.0.1:54264 +15ms cypress:plugin:ntlm-auth Startup done! +0ms cypress:plugin:ntlm-auth { cypress:plugin:ntlm-auth configApiUrl: 'http://127.0.0.1:54263', cypress:plugin:ntlm-auth ntlmProxyUrl: 'http://127.0.0.1:54264' cypress:plugin:ntlm-auth } +0ms cypress:plugin:ntlm-auth Opening Cypress... +3ms

DevTools listening on ws://127.0.0.1:54265/devtools/browser/5c6b6e7b-5df2-4561-a413-af9a686bff6b
  cypress:plugin:ntlm-auth getTargetHost - host header  localhost:54266 +1s
  cypress:plugin:ntlm-auth Created agent for client 127.0.0.1:54267 to target http://localhost:54266/ +18ms
  cypress:plugin:ntlm-auth Request to http://localhost:54266/ - pass on +12ms
  cypress:plugin:ntlm-auth getTargetHost - host header  localhost:54266 +368ms
  cypress:plugin:ntlm-auth getTargetHost - host header  localhost:54266 +231ms
  cypress:plugin:ntlm-auth Request to http://localhost:54266/ - pass on +23ms
  cypress:plugin:ntlm-auth getTargetHost - host header  localhost:54266 +3ms
  cypress:plugin:ntlm-auth Created agent for client 127.0.0.1:54269 to target http://localhost:54266/ +73ms
  cypress:plugin:ntlm-auth Request to http://localhost:54266/ - pass on +52ms
  cypress:plugin:ntlm-auth getTargetHost - host header  localhost:54266 +58ms
  cypress:plugin:ntlm-auth getTargetHost - host header  localhost:54266 +84ms
  cypress:plugin:ntlm-auth Tunnel to localhost:54266 +755ms
  cypress:plugin:ntlm-auth getTargetHost - host header  localhost:54266 +28ms
  cypress:plugin:ntlm-auth Request to http://localhost:54266/ - pass on +0ms
  cypress:plugin:ntlm-auth getTargetHost - host header  localhost:54266 +4ms
  cypress:plugin:ntlm-auth Tunnel to localhost:54266 +25ms
  cypress:plugin:ntlm-auth getTargetHost - host header  localhost:54266 +4ms
  cypress:plugin:ntlm-auth Request to http://localhost:54266/ - pass on +0ms
  cypress:plugin:ntlm-auth getTargetHost - host header  registry.npmjs.org:80 +829ms
  cypress:plugin:ntlm-auth Created agent for client 127.0.0.1:54277 to target https://registry.npmjs.org:80/ +3ms
  cypress:plugin:ntlm-auth Request to https://registry.npmjs.org:80/ - pass on +0ms
  cypress:plugin:ntlm-auth:tunnelagent [0]: tunneling socket could not be established, statusCode=403 +0ms
  cypress:plugin:ntlm-auth getTargetHost - host header  download.cypress.io:80 +361ms
  cypress:plugin:ntlm-auth Created agent for client 127.0.0.1:54281 to target https://download.cypress.io:80/ +9ms
  cypress:plugin:ntlm-auth Request to https://download.cypress.io:80/ - pass on +7ms
  cypress:plugin:ntlm-auth:tunnelagent [1]: tunneling socket could not be established, statusCode=403 +60ms
"npx cypress-ntlm open"  cypress:plugin:ntlm-auth getTargetHost - host header  localhost:54266 +2s
  cypress:plugin:ntlm-auth Removed agent for 127.0.0.1:54267 due to socket.close +2s
  cypress:plugin:ntlm-auth getTargetHost - host header  localhost:54266 +991ms
  cypress:plugin:ntlm-auth Request to http://localhost:54266/ - pass on +0ms
cypress-ntlm-auth: Certificate validation failed for "download.cypress.io:80". ETIMEDOUT
  cypress:plugin:ntlm-auth WARN: Certificate validation failed for "download.cypress.io:80". AggregateError [ETIMEDOUT]:
    at internalConnectMultiple (node:net:1116:18)
    at afterConnectMultiple (node:net:1680:7) {
  code: 'ETIMEDOUT',
  [errors]: [
    Error: connect ETIMEDOUT 104.22.11.239:80
        at createConnectionError (node:net:1643:14)
        at Timeout.internalConnectMultipleTimeout (node:net:1702:38)
        at listOnTimeout (node:internal/timers:575:11)
        at process.processTimers (node:internal/timers:514:7) {
      errno: -4039,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '104.22.11.239',
      port: 80
    },
    Error: connect ETIMEDOUT 104.22.10.239:80
        at createConnectionError (node:net:1643:14)
        at Timeout.internalConnectMultipleTimeout (node:net:1702:38)
        at listOnTimeout (node:internal/timers:575:11)
        at process.processTimers (node:internal/timers:514:7) {
      errno: -4039,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '104.22.10.239',
      port: 80
    },
    Error: connect ETIMEDOUT 172.67.25.250:80
        at createConnectionError (node:net:1643:14)
        at afterConnectMultiple (node:net:1673:16) {
      errno: -4039,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '172.67.25.250',
      port: 80
    }
  ]
} +17s
cypress-ntlm-auth: Certificate validation failed for "registry.npmjs.org:80". ETIMEDOUT
  cypress:plugin:ntlm-auth WARN: Certificate validation failed for "registry.npmjs.org:80". AggregateError [ETIMEDOUT]:
    at internalConnectMultiple (node:net:1116:18)
    at afterConnectMultiple (node:net:1680:7) {
  code: 'ETIMEDOUT',
  [errors]: [
    Error: connect ETIMEDOUT 104.16.27.34:80
        at createConnectionError (node:net:1643:14)
        at Timeout.internalConnectMultipleTimeout (node:net:1702:38)
        at listOnTimeout (node:internal/timers:575:11)
        at process.processTimers (node:internal/timers:514:7) {
      errno: -4039,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '104.16.27.34',
      port: 80
    },
    Error: connect ETIMEDOUT 104.16.0.35:80
        at createConnectionError (node:net:1643:14)
        at Timeout.internalConnectMultipleTimeout (node:net:1702:38)
        at listOnTimeout (node:internal/timers:575:11)
        at process.processTimers (node:internal/timers:514:7) {
      errno: -4039,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '104.16.0.35',
      port: 80
    },
    Error: connect ETIMEDOUT 104.16.30.34:80
        at createConnectionError (node:net:1643:14)
        at Timeout.internalConnectMultipleTimeout (node:net:1702:38)
        at listOnTimeout (node:internal/timers:575:11)
        at process.processTimers (node:internal/timers:514:7) {
      errno: -4039,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '104.16.30.34',
      port: 80
    },
    Error: connect ETIMEDOUT 104.16.24.34:80
        at createConnectionError (node:net:1643:14)
        at Timeout.internalConnectMultipleTimeout (node:net:1702:38)
        at listOnTimeout (node:internal/timers:575:11)
        at process.processTimers (node:internal/timers:514:7) {
      errno: -4039,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '104.16.24.34',
      port: 80
    },
    Error: connect ETIMEDOUT 104.16.3.35:80
        at createConnectionError (node:net:1643:14)
        at Timeout.internalConnectMultipleTimeout (node:net:1702:38)
        at listOnTimeout (node:internal/timers:575:11)
        at process.processTimers (node:internal/timers:514:7) {
      errno: -4039,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '104.16.3.35',
      port: 80
    },
    Error: connect ETIMEDOUT 104.16.26.34:80
        at createConnectionError (node:net:1643:14)
        at Timeout.internalConnectMultipleTimeout (node:net:1702:38)
        at listOnTimeout (node:internal/timers:575:11)
        at process.processTimers (node:internal/timers:514:7) {
      errno: -4039,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '104.16.26.34',
      port: 80
    },
    Error: connect ETIMEDOUT 104.16.25.34:80
        at createConnectionError (node:net:1643:14)
        at Timeout.internalConnectMultipleTimeout (node:net:1702:38)
        at listOnTimeout (node:internal/timers:575:11)
        at process.processTimers (node:internal/timers:514:7) {
      errno: -4039,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '104.16.25.34',
      port: 80
    },
    Error: connect ETIMEDOUT 104.16.2.35:80
        at createConnectionError (node:net:1643:14)
        at Timeout.internalConnectMultipleTimeout (node:net:1702:38)
        at listOnTimeout (node:internal/timers:575:11)
        at process.processTimers (node:internal/timers:514:7) {
      errno: -4039,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '104.16.2.35',
      port: 80
    },
    Error: connect ETIMEDOUT 104.16.28.34:80
        at createConnectionError (node:net:1643:14)
        at Timeout.internalConnectMultipleTimeout (node:net:1702:38)
        at listOnTimeout (node:internal/timers:575:11)
        at process.processTimers (node:internal/timers:514:7) {
      errno: -4039,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '104.16.28.34',
      port: 80
    },
    Error: connect ETIMEDOUT 104.16.31.34:80
        at createConnectionError (node:net:1643:14)
        at Timeout.internalConnectMultipleTimeout (node:net:1702:38)
        at listOnTimeout (node:internal/timers:575:11)
        at process.processTimers (node:internal/timers:514:7) {
      errno: -4039,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '104.16.31.34',
      port: 80
    },
    Error: connect ETIMEDOUT 104.16.29.34:80
        at createConnectionError (node:net:1643:14)
        at Timeout.internalConnectMultipleTimeout (node:net:1702:38)
        at listOnTimeout (node:internal/timers:575:11)
        at process.processTimers (node:internal/timers:514:7) {
      errno: -4039,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '104.16.29.34',
      port: 80
    },
    Error: connect ETIMEDOUT 104.16.1.35:80
        at createConnectionError (node:net:1643:14)
        at afterConnectMultiple (node:net:1673:16) {
      errno: -4039,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '104.16.1.35',
      port: 80
    }
  ]
} +2s

— Reply to this email directly, view it on GitHub https://github.com/bjowes/cypress-ntlm-auth/issues/245, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCHR3CNXE2XQT7R2H6V6FLYO5NBVAVCNFSM6AAAAABB55OT32VHI2DSMVQWIX3LMV43ASLTON2WKOZSGA4DKNBRGEZDONA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

EEO27 commented 8 months ago

Thank for the fast response. I have tried already several things in the environment variables and none of them worked for me.

Because it works perfectly when I run cypress in the CLI, am I now wondering if it should be possible to just load the plugin separately and open Cypress separatly?

Just to avoid the message "The cypress-ntlm-auth plugin must be loaded before using this method" when I command "npx cypres open"

Do you think that this is possible?

bjowes commented 8 months ago

They can be started separately but you would still need to configure Cypress to use cypress-ntlm as its proxy - this is how the authentication is achieved. So I don't think that would help you.

On Wed, Jan 17, 2024 at 10:13 AM EEO27 @.***> wrote:

Thank for the fast response. I have tried already several things in the environment variables and none of them worked for me.

Because it works perfectly when I run cypress in the CLI, am I now wondering if it is possible to just load the plugin separately and open Cypress separatly?

Do you think that this is possible?

— Reply to this email directly, view it on GitHub https://github.com/bjowes/cypress-ntlm-auth/issues/245#issuecomment-1895392225, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCHR3FDL5ZWUVLKVXPLSQ3YO6I3LAVCNFSM6AAAAABB55OT32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJVGM4TEMRSGU . You are receiving this because you commented.Message ID: @.***>

EEO27 commented 8 months ago

Thanks again for the fast response!

What value or variable should I have to check than? I can see that Cypress is taking the proxy settings from Windows VDI. I you can tell me which values are neccesery to match, I can check them

bjowes commented 8 months ago

You should set the environment variable HTTP_PROXY to the value shown in the Proxy Server field in Cypress UI.

And, if the value of Proxy Bypass List contains anything else than localhost, 127.0.0.1 or ::1, set those values in the environment variable NO_PROXY. Example: Proxy Bypass List includes 192.0.1.3 and 45.2.45.2 (in addition to the localhost values), then set NO_PROXY=192.0.1.3,54.2.54.2

There are examples in the readme on how to set environment variables if you are unsure. Then launch cypress-ntlm. Note that the Proxy Server and Proxy Bypass List will show different values when run through cypress-ntlm, this is expected.

bjowes commented 8 months ago

Since configuring the proxy settings is a recurring issue, I decided to try to implement the same auto detection of proxy settings on Windows that is used by cypress. If you want to contribute, please try out cypress-ntlm-auth@4.2.0-beta.1. With that version, you should not set HTTP_PROXY or NO_PROXY environment variables, they will be read from the registry if they are not set.

Since I am developing on a Mac, I haven't tried this live yet, so report back on the progress.

EEO27 commented 8 months ago

Hi youre beta did not work. But I found the solution. I just deleted the following environment variable in VDI windows: http-proxy, https-proxy and noproxy.

restart vscode

And things worked nicely.

bjowes commented 8 months ago

Awesome, thanks for the update!

On Thu, Jan 18, 2024 at 1:41 PM EEO27 @.***> wrote:

Hi youre beta did not work. But I found the solution. I just deleted the following environment variable in VDI windows: http-proxy, https-proxy and noproxy.

restart vscode

And things worked nicely.

— Reply to this email directly, view it on GitHub https://github.com/bjowes/cypress-ntlm-auth/issues/245#issuecomment-1898408191, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCHR3GZO63FVAT7CUW2D4LYPEKAFAVCNFSM6AAAAABB55OT32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJYGQYDQMJZGE . You are receiving this because you commented.Message ID: @.***>

EEO27 commented 6 months ago

After correcting the proxy settings it works when running in CLI --headed.

Solution here: https://github.com/bjowes/cypress-ntlm-auth/issues/250