Bug 55006

Summary: Add http proxy support for ClientEndpoint using system properties [PATCH]
Product: Tomcat 8 Reporter: Niki Dokovski <nickytd>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Severity: enhancement CC: scottyfred
Priority: P2    
Version: 8.0.x-trunk   
Target Milestone: ----   
Hardware: PC   
OS: All   
Attachments: patch in WsWebSocketContainer
patch in WsWebSocketContainer, LocalString.properties

Description Niki Dokovski 2013-05-22 11:04:02 UTC
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
Comment 1 Niki Dokovski 2013-05-22 11:04:26 UTC
Created attachment 30310 [details]
patch in WsWebSocketContainer
Comment 2 Mark Thomas 2013-05-30 14:34:09 UTC
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.
Comment 3 Konstantin Kolinko 2013-06-03 12:13:21 UTC
(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?
Comment 4 Niki Dokovski 2013-06-12 04:42:43 UTC
Created attachment 30426 [details]
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
Comment 5 Mark Thomas 2015-11-23 22:21:51 UTC
Thanks for the patch. I used it as a basis for the fix that has been applied to 9.0.x (for 9.0.0.M2 onwards), 8.0.x (for 8.0.30 onwards) and 7.0.x (for 7.0.66 onwards).