Search code examples
javaproxyweblogicproxyselector

Weblogic setting for proxy


I have a problem with configuration of proxy to connect to WebService on Weblogic 10.3.5. I cannot use System.setProperty() because it has to be per connection aproach. Proxy which I have to use has to have "UserAgent" header.

I have tried two options:

  1. ClientProxyFeature but it doesn't work because it generate request to proxy without "UserAgent header".
  2. ProxySelector: this approach work great on JUnit test but when I run it on Weblogic I receive following error

error: java.net.SocketException: Unknown proxy type : HTTP at...

Is there any way to work this around? Many Thanks in advance

Adam


Solution

  • We are able to do this with ProxySelector. The only thing which we have changed was server start parameter: -DUseSunHttpHandler=true. Now it works and send User-Agent header.