idea 配置http代理

工作的环境是在局域网,想要访问外网都是通过代理来访问外网的,最近自己在写maven项目,需要用的依赖下载不能直接访问外部网络,需要配置代理

1.首先在idea里面配置代理地址 settings->system settings ->下的http proxy 在host name 填写自己局域网的地址 还有下面的端口号

提示:关于怎么查看局域网的代理地址 打开ie浏览器 右上角设置 然后internet 设置

配置好了这一步。

2.设置maven配置文件里面的代理地址

在maven 的配置文件settings.xml 里面添加以下标签节点

<proxies>
    <!-- proxy
     | Specification for one proxy, to be used in connecting to the network.
     |
    <proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <username>proxyuser</username>
      <password>proxypass</password>
      <host>proxy.host.net</host>
      <port>80</port>
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>
    -->
    <proxy>
            <id>my-proxy</id>
            <active>true</active>
            <protocol>http</protocol>
            <host>172.xxx.xxx.20</host>  代理的ip
            <port>3xx8</port>           代理的端口
        </proxy>
  </proxies>

按着这上面两步可以解决不能直接访问外网的状态。

猜你喜欢

转载自www.cnblogs.com/zfding/p/9072311.html
今日推荐