sjitech / proxy-login-automator

A single node.js script to automatically inject user/password to http proxy server via a local forwarder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incompatible with Node.js > 10

ianrenauld opened this issue · comments

Hi, first of all, many thanks for proxy-login-automator it is a god send for doing E2E automation with an environment available only behind a proxy that requires authentication, which Selenium can't handle at the moment. I'm sure I could find a similar big proxy tool to do that, but the convenience of being able to simply install it through npm and run it through node is truly wonderful!

Having said, that I discovered yesterday that proxy-login-automator doesn't work with Node.js LTS 12.20.0 and Node.js LTS 14.15.1. It's only working for me with Node.js version 10.x LTS.

The behavior is that proxy-login-automator starts correctly and waits for connections. As soon as some network connections are made, it errors out, with two possible outcome (Node.js 12 gives a bit more stack trace, while Node.js 14 is pretty silent about what went wrong):

We get either this error:

[LocalProxy(:8081)] OK: forward http://localhost:8081 to  to http://10.194.20.100:8080
[LocalProxy(:8081)][Incoming connection] Error: read ECONNRESET
Segmentation fault: 11

Or this one:

[LocalProxy(:8081)] OK: forward http://localhost:8081 to  to http://10.194.20.100:8080
[LocalProxy(:8081)][Incoming connection] Error: read ECONNRESET
node(7206,0x10a70adc0) malloc: can't allocate region
:*** mach_vm_map(size=7205759404062232576, flags: 40000100) failed (error code=3)
node(7206,0x10a70adc0) malloc: *** set a breakpoint in malloc_error_break to debug
libc++abi.dylib: terminating with uncaught exception of type std::bad_alloc: std::bad_alloc
Abort trap: 6

This is on a MacBook Pro, running MacOS 10.15.7, in case this has an impact.

Node.js 10 LTS is ending maintenance in April 2021 and we are seeing more and more dependency packages start to move to newer required versions. I would hope we can get proxy-login-automator to work with Node.js 12 and 14 so I don't have to keep a spare Node.js version 10 just to run it.

For those looking for a fix to this, because it seems this package is not really maintained anymore, there is a fork from this repo that does work with Node.js 12 at least (haven't tried newer versions, but I assume they would work as well): https://github.com/carvalhonm/proxy-login-automator

Thanks ianrenauld, fork by carvalhonm also works with Node 14.5. Fork by yadaaut doesn't fix buffer and has a hard coded path which needs to be editted for Windows. I didn't try other forks. I'll stay with carvalhonm's fork.