Set proxy through windows command line including login parameters

后端 未结 4 1856
离开以前
离开以前 2021-01-30 03:41

I want to set a proxy throught the command line, first thing I found out is that you have to run command line with administrator rights - then the basic proxy s

相关标签:
4条回答
  • 2021-01-30 03:48

    IE can set username and password proxies, so maybe setting it there and import does work

    reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1
    reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /t REG_SZ /d name:port
    reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyUser /t REG_SZ /d username
    reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyPass /t REG_SZ /d password
    netsh winhttp import proxy source=ie
    
    0 讨论(0)
  • 2021-01-30 03:49

    If you are using Microsoft windows environment then you can set a variable named HTTP_PROXY, FTP_PROXY, or HTTPS_PROXY depending on the requirement.

    I have used following settings for allowing my commands at windows command prompt to use the browser proxy to access internet.

    set HTTP_PROXY=http://proxy_userid:proxy_password@proxy_ip:proxy_port
    

    The parameters on right must be replaced with actual values.

    Once the variable HTTP_PROXY is set, all our subsequent commands executed at windows command prompt will be able to access internet through the proxy along with the authentication provided.

    Additionally if you want to use ftp and https as well to use the same proxy then you may like to the following environment variables as well.

    set FTP_PROXY=%HTTP_PROXY%
    
    set HTTPS_PROXY=%HTTP_PROXY%
    
    0 讨论(0)
  • 2021-01-30 04:05

    The best way around this is (and many other situations) in my experience, is to use cntlm which is a local no-authentication proxy which points to a remote authentication proxy. You can then just set WinHTTP to point to your local CNTLM (usually localhost:3128), and you can set CNTLM itself to point to the remote authentication proxy. CNTLM has a "magic NTLM dialect detection" option which generates password hashes to be put into the CNTLM configuration files.

    0 讨论(0)
  • 2021-01-30 04:09

    cmd

    Tunnel all your internet traffic through a socks proxy:

    netsh winhttp set proxy proxy-server="socks=localhost:9090" bypass-list="localhost"
    

    View the current proxy settings:

    netsh winhttp show proxy
    

    Clear all proxy settings:

    netsh winhttp reset proxy
    
    0 讨论(0)
提交回复
热议问题