Skip to content

Instantly share code, notes, and snippets.

@pydemo
Forked from triskell/cntlm_npm.md
Created April 29, 2020 21:20
Show Gist options
  • Save pydemo/10e10b7a490e7a29c3f832c3385cf4ad to your computer and use it in GitHub Desktop.
Save pydemo/10e10b7a490e7a29c3f832c3385cf4ad to your computer and use it in GitHub Desktop.
[Windows 7] CNTLM and NPM behind NTLM proxy

CNTLM and NPM behind NTLM proxy on Windows 7

CNTLM

  • Install CNTLM in a folder where you have full rights to run it as administrator.

  • Open cntlm.ini and fill it :

Username    YOUR_USERNAME
Domain      YOUR_DOMAIN
Proxy       YOUR_PROXY_IP:PORT
Listen      53128

!!! DON'T FILL THE PASSWORD FIELD !!!

  • Open a console to generate password hashes :
> cd c:\the_install_directory_of_cntlm
> cntlm –c cntlm.ini –H
Password: ...type proxy password here...
PassLM          D6888AC8AE0EEE294D954420463215AE
PassNT          0E1FAED265D32EBBFB15F410D27994B2
PassNTLMv2      91E810C86B3FD1BD14342F945ED42CD6

Copy those tree lines behin Domainfield. !!! AGAIN, DON'T FILL THE PASSWORD FIELD !!!

  • Run the console as administrator and copy the following line to determine if the settings work :
    cntlm –c cntlm.ini –I –M http://www.google.co.uk You should have a success message. If not, check the previous steps.

  • (Optional, only if the "Start CNTML proxy" shortcut does not exist yet) Create start_cntlm.bat file where you want :

cd c:\the_install_directory_of_cntlm
cntlm -v -f -c "cntlm.ini"
  • Run start_cntlm.bat as administrator to start CNTLM service. Keep the console open. Closing it will stop the service.

NPM

  • Open a console and copy those 3 lines :
> npm config set proxy http://localhost:53128
> npm config set https-proxy http://localhost:53128
> npm config set registry http://registry.npmjs.org
  • Start CNTLM service.

  • Every nmp command should work. You can try with :
    > npm view qunit

  • Enjoy.

Sources

[http://stackoverflow.com/questions/18569054/npm-behind-ntlm-proxy/18570201#18570201] [http://stormpoopersmith.com/2012/03/20/using-applications-behind-a-corporate-proxy/]

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