samuong / alpaca

A local HTTP proxy for command-line tools. Supports PAC scripts and NTLM authentication.
Apache License 2.0
184 stars 31 forks source link

Find and listen on all available networks #105

Closed marcelocantos closed 1 year ago

marcelocantos commented 1 year ago

This was motivated by npm being unable to proxy through alpaca via npm set config http://localhost:3128 since node 17+ favours IPv6, whereas Go's net.Listen favours IPv4 when a hostname is supplied.

This PR performs a hostname lookup and detects the networks (tcp4/tcp6) for all returned IPs.