You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2013/05/22 13:04:02 UTC

[Bug 55006] New: Add http proxy support for ClientEndpoint using system properties

https://issues.apache.org/bugzilla/show_bug.cgi?id=55006

            Bug ID: 55006
           Summary: Add http proxy support for ClientEndpoint using system
                    properties
           Product: Tomcat 8
           Version: trunk
          Hardware: PC
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: nickytd@gmail.com
    Classification: Unclassified

Currently there is no support for utilization of http proxy for
ClientEndpoints. Here is a patch that illustrates the usage of
http(s).proxy(Host)(Port) system properties. A request for improvement in
WebSocket JSR 356 can be found here
https://java.net/jira/browse/WEBSOCKET_SPEC-202

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 55006] Add http proxy support for ClientEndpoint using system properties

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55006

--- Comment #2 from Mark Thomas <ma...@apache.org> ---
I'd like to wait for some indication of which way the WebSocket EG is going to
head on this before starting any implementation.

Generally, I dislike using system properties for any kind of configuration.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 55006] Add http proxy support for ClientEndpoint using system properties [PATCH]

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55006

Christopher Schultz <ch...@christopherschultz.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Add http proxy support for  |Add http proxy support for
                   |ClientEndpoint using system |ClientEndpoint using system
                   |properties                  |properties [PATCH]

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 55006] Add http proxy support for ClientEndpoint using system properties [PATCH]

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55006

Scott Frederick <sc...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |scottyfred@gmail.com

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


Re: [Bug 55006] Add http proxy support for ClientEndpoint using system properties

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Niki,

Perhaps you should put some of this discussion into the Bugzilla issue
so it can be tracked more easily by anyone interested in the progress.

-chris

On 6/4/13 1:55 AM, Niki Dokovski wrote:
> On Tue, Jun 4, 2013 at 12:01 AM, Rossen Stoyanchev <
> rstoyanchev@gopivotal.com> wrote:
> 
>> On Mon, Jun 3, 2013 at 10:27 AM, Niki Dokovski <ni...@gmail.com> wrote:
>>
>>> On Mon, Jun 3, 2013 at 3:44 PM, Niki Dokovski <ni...@gmail.com>
>> wrote:Further
>>> on, if you choose to use connectToServer call that has the
>>> ClientEndpointConfig param you are losing the annotation approach as the
>>> first param of this call has to be an instance of an Endpoint. Hence your
>>> class can not be just annotated. hmmm Mark where can we bring this
>>> discussion?
>>
>>
>> This is not very obvious from the API but ClientEndpointConfig (and
>> ServerEndpointConfig) are not meant to be used with annotated endpoints. In
>> other words, I think the methods accepting those types are for use with
>> type-based endpoints (i.e. javax.websocket.Endpoint). So as far as I can
>> see user properties can be updated before the session starts only for
>> type-based endpoints.
>>
> 
> Exactly, What is the rationale behind this?
> Still an annotated endpoint can supply
> javax.websocket.ClientEndpointConfig.Configurator
> but has no access to the user properties from there. May be the
> javax.websocket.ClientEndpointConfig.Configurator
> can be extended to provide access to the map.
> 
> cheers
> 
> 
>>
>> Rossen
>>
> 


Re: [Bug 55006] Add http proxy support for ClientEndpoint using system properties

Posted by Niki Dokovski <ni...@gmail.com>.
On Tue, Jun 4, 2013 at 12:01 AM, Rossen Stoyanchev <
rstoyanchev@gopivotal.com> wrote:

> On Mon, Jun 3, 2013 at 10:27 AM, Niki Dokovski <ni...@gmail.com> wrote:
>
> > On Mon, Jun 3, 2013 at 3:44 PM, Niki Dokovski <ni...@gmail.com>
> wrote:Further
> > on, if you choose to use connectToServer call that has the
> > ClientEndpointConfig param you are losing the annotation approach as the
> > first param of this call has to be an instance of an Endpoint. Hence your
> > class can not be just annotated. hmmm Mark where can we bring this
> > discussion?
>
>
> This is not very obvious from the API but ClientEndpointConfig (and
> ServerEndpointConfig) are not meant to be used with annotated endpoints. In
> other words, I think the methods accepting those types are for use with
> type-based endpoints (i.e. javax.websocket.Endpoint). So as far as I can
> see user properties can be updated before the session starts only for
> type-based endpoints.
>

Exactly, What is the rationale behind this?
Still an annotated endpoint can supply
javax.websocket.ClientEndpointConfig.Configurator
but has no access to the user properties from there. May be the
javax.websocket.ClientEndpointConfig.Configurator
can be extended to provide access to the map.

cheers


>
> Rossen
>

Re: [Bug 55006] Add http proxy support for ClientEndpoint using system properties

Posted by Rossen Stoyanchev <rs...@gopivotal.com>.
On Mon, Jun 3, 2013 at 10:27 AM, Niki Dokovski <ni...@gmail.com> wrote:

> On Mon, Jun 3, 2013 at 3:44 PM, Niki Dokovski <ni...@gmail.com> wrote:Further
> on, if you choose to use connectToServer call that has the
> ClientEndpointConfig param you are losing the annotation approach as the
> first param of this call has to be an instance of an Endpoint. Hence your
> class can not be just annotated. hmmm Mark where can we bring this
> discussion?


This is not very obvious from the API but ClientEndpointConfig (and
ServerEndpointConfig) are not meant to be used with annotated endpoints. In
other words, I think the methods accepting those types are for use with
type-based endpoints (i.e. javax.websocket.Endpoint). So as far as I can
see user properties can be updated before the session starts only for
type-based endpoints.

Rossen

Re: [Bug 55006] Add http proxy support for ClientEndpoint using system properties

Posted by Niki Dokovski <ni...@gmail.com>.
On Mon, Jun 3, 2013 at 3:44 PM, Niki Dokovski <ni...@gmail.com> wrote:

>
>
>
> On Mon, Jun 3, 2013 at 3:13 PM, <bu...@apache.org> wrote:
>
>> https://issues.apache.org/bugzilla/show_bug.cgi?id=55006
>>
>> --- Comment #3 from Konstantin Kolinko <kn...@gmail.com> ---
>> (In reply to Mark Thomas from comment #2)
>> > Generally, I dislike using system properties for any kind of
>> configuration.
>>
>> I do as well.
>>
>> How about using ClientEndpointConfig.getUserProperties() to pass those?
>>
>
> +1
> In general, I'm fine with any proposal that removes the limitation. Just
> hope that JSR 356 EG won't wait for Java EE 8 to come up with an update.
>  Meanwhile people can use current patch. Or we can craft something based on
> user configurations in ClientEndpoint leveraging Mark's ProxySelector. I'll
> give it a try...
>
> cheers
>

At first look,  It turned to be a bit challenging of how to get to the
modifiable user properties map if you work only with annotated class.

Just created another bug for the spec. (The javadoc in one of the
connectToServer methods should be changed as it states that the supplied
object should be annotated with ServerEndpoint where it actually should be
annotated with ClientEndpoint.
https://java.net/jira/browse/WEBSOCKET_SPEC-206


Further on, if you choose to use connectToServer call that has the
ClientEndpointConfig param you are losing the annotation approach as the
first param of this call has to be an instance of an Endpoint. Hence your
class can not be just annotated. hmmm Mark where can we bring this
discussion?




>
>> --
>> You are receiving this mail because:
>> You are the assignee for the bug.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>
>>
>

Re: [Bug 55006] Add http proxy support for ClientEndpoint using system properties

Posted by Niki Dokovski <ni...@gmail.com>.
On Mon, Jun 3, 2013 at 3:13 PM, <bu...@apache.org> wrote:

> https://issues.apache.org/bugzilla/show_bug.cgi?id=55006
>
> --- Comment #3 from Konstantin Kolinko <kn...@gmail.com> ---
> (In reply to Mark Thomas from comment #2)
> > Generally, I dislike using system properties for any kind of
> configuration.
>
> I do as well.
>
> How about using ClientEndpointConfig.getUserProperties() to pass those?
>

+1
In general, I'm fine with any proposal that removes the limitation. Just
hope that JSR 356 EG won't wait for Java EE 8 to come up with an update.
 Meanwhile people can use current patch. Or we can craft something based on
user configurations in ClientEndpoint leveraging Mark's ProxySelector. I'll
give it a try...

cheers

>
> --
> You are receiving this mail because:
> You are the assignee for the bug.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>

[Bug 55006] Add http proxy support for ClientEndpoint using system properties

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55006

--- Comment #3 from Konstantin Kolinko <kn...@gmail.com> ---
(In reply to Mark Thomas from comment #2)
> Generally, I dislike using system properties for any kind of configuration.

I do as well.

How about using ClientEndpointConfig.getUserProperties() to pass those?

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 55006] Add http proxy support for ClientEndpoint using system properties

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55006

--- Comment #1 from Niki Dokovski <ni...@gmail.com> ---
Created attachment 30310
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=30310&action=edit
patch in WsWebSocketContainer

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 55006] Add http proxy support for ClientEndpoint using system properties

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55006

Niki Dokovski <ni...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #30310|0                           |1
        is obsolete|                            |

--- Comment #4 from Niki Dokovski <ni...@gmail.com> ---
Created attachment 30426
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=30426&action=edit
patch in WsWebSocketContainer, LocalString.properties

This is a patch in WsWebSocketContainer based on ProxySelector proposed by
Mark, Still the patch doesn't address how the http proxy settings are
specified. It just iterates over ProxySelector.getDefault(). The discussion in
the JSR 356 EG should define the mechanism for describing the proxy per
ClientEndpoint

-- 
You are receiving this mail because:
You are the assignee for the bug.

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