Set proxy through windows command line including login parameters

后端 未结 4 1855
离开以前
离开以前 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: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%
    

提交回复
热议问题