You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Thomas Recloux <th...@gmail.com> on 2006/01/31 17:48:05 UTC

Specify multiple proxies

Hello all,

I need to use my office proxy to access two repositories:

- The central repository on Ibibio using the http protocol.
- An enterprise internal repository located in an other country, using
the https protocol.

I submitted a patch on wagon
(http://jira.codehaus.org/browse/WAGONHTTP-6) for it to use the proxy
for the https protocol.

I still have a problem:
- In the settings file, I can specify one protocol by proxy, so I have
to specify one proxy for each protocol. Like this:
<proxies>
    <proxy>
      <id>proxy-http</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>proxy</host>
      <port>8080</port>
    </proxy>
    <proxy>
      <id>proxy-https</id>
      <active>true</active>
      <protocol>https</protocol>
      <host>proxy</host>
      <port>8080</port>
    </proxy>
  </proxies>

- This configuration is transferred from the Settings object to the
DefaultWagonManager object by the DefaultMaven object. But this object
transfers only the first active proxy which is retrieved by the
getActiveProxy method of the Settings object.

- In my case, only one proxy (the first one) will be added to the
DefaultWagonManager and my https request won't be send to the proxy
server.

I see two solutions:
- Keeping only one active proxy and add a way to specify multiple
protocols by proxy.
- Modify the Settings and DefaultMaven objects to add one active proxy
server by protocol.

What do you think of this? If you choose one of theses solutions, I
can post the patch.

Thomas.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Specify multiple proxies

Posted by Brett Porter <br...@apache.org>.
Thomas Recloux wrote:
> 2006/1/31, Brett Porter <br...@apache.org>:
> 
>> I'd start with the second one as it doesn't requires model changes and
>> can be included in Maven 2.0.3.
> 
> OK, I'll work on it. Should I create a jira issue ? On the MNG project ?

yes, please.

> 
>> I'd also special case https to use the http proxy if none is defined.
> 
> I'm not sure to understand, If no https proxy is specified, use the
> http proxy ? You would manage it in which component ?

That's what I was thinking. I'm not sure if its best in wagon or the
wagon manager (probably easier in the latter for now).

- Brett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Specify multiple proxies

Posted by Thomas Recloux <th...@gmail.com>.
2006/1/31, Brett Porter <br...@apache.org>:

> I'd start with the second one as it doesn't requires model changes and
> can be included in Maven 2.0.3.

OK, I'll work on it. Should I create a jira issue ? On the MNG project ?

> I'd also special case https to use the http proxy if none is defined.

I'm not sure to understand, If no https proxy is specified, use the
http proxy ? You would manage it in which component ?

--
Thomas Recloux

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Specify multiple proxies

Posted by Steve Loughran <st...@apache.org>.
Brett Porter wrote:
> Thomas Recloux wrote:
>> I see two solutions:
>> - Keeping only one active proxy and add a way to specify multiple
>> protocols by proxy.
>> - Modify the Settings and DefaultMaven objects to add one active proxy
>> server by protocol.
>>
>> What do you think of this? If you choose one of theses solutions, I
>> can post the patch.
> 
> I think they are both good solutions and maybe could be used together.
> I'd start with the second one as it doesn't requires model changes and
> can be included in Maven 2.0.3.
> 
> I'd also special case https to use the http proxy if none is defined.
> 

Proxy setup in java is a real pain. Personally I'd like apps on my 
laptop to try and use a proxy if nslookup fails then skip it if not, but 
try explaining that to Java, even Java1.5. And don't even mention the 
autoproxy stuff in Java1.5 as it doesn't work. My laptop is clever 
enough to change IE's proxy settings as it roams (see 
http://www.hpl.hp.com/techreports/2001/HPL-2001-158.pdf ) , and yet the 
java 5 proxy stuff doesnt pick up even static things.

My planned workaround for all this is to actually host a local proxy and 
route everything through there, with that separate program containing 
all the logic for proxy binding hosted there -it'd contain the 
intelligence to choose proxy based on WLAN ID, IP address &c,  and have 
a single override point.

-steve

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Specify multiple proxies

Posted by Brett Porter <br...@apache.org>.
Thomas Recloux wrote:
> I see two solutions:
> - Keeping only one active proxy and add a way to specify multiple
> protocols by proxy.
> - Modify the Settings and DefaultMaven objects to add one active proxy
> server by protocol.
> 
> What do you think of this? If you choose one of theses solutions, I
> can post the patch.

I think they are both good solutions and maybe could be used together.
I'd start with the second one as it doesn't requires model changes and
can be included in Maven 2.0.3.

I'd also special case https to use the http proxy if none is defined.

- Brett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org