[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setting proxy host and port in matlab/java



Hi all:

According to address@hidden, setting the following System properties (eg on the java command line) will allow a proxy to work:

   String proxyHost = System.getProperty("http.proxyHost");
   String proxyPort = System.getProperty("http.proxyPort");
   if ((proxyHost != null) && (proxyPort != null)) {
_client.getHostConfiguration().setProxy(proxyHost, Integer.parseInt(proxyPort));

the above lines of code are in ucar.nc2.util.net.HttpClientManager which is our interface to org.apache.commons.httpclient, used by the DConnect2 opendap client.

I havent made this work myself, although nick said it worked for him. Since you are having trouble with those settings, I am cc'ing him in case he can help.


James Gallagher wrote:

On Jan 11, 2010, at 3:00 PM, Tim Pugh wrote:

Hi James,

I'm having an issue with MATLAB and SNCTOOLS not retrieving data from opendap servers when a proxy server is used. Am I setting up MATLAB and Java tools correctly to talk with the proxy server? See my message below to John.

Any help would be appreciated.

Tim, the key is to set up proxy support with the opendap-java code. I don't know if such support exists.

John?

James

  - Tim -


Begin forwarded message:

*From: *John Evans <address@hidden <mailto:address@hidden>>
*Date: *12 January 2010 5:45:02 AM
*To: *Tim Pugh <address@hidden <mailto:address@hidden>>
*Subject: **Re: setting proxy host and port in matlab/java*

Hi Tim,

To be honest, no, I've not tried to do such a thing before. I'll look into it, but I'm not hopeful of coming up with anything useful.


On Mon, Jan 11, 2010 at 12:09 PM, Tim Pugh <address@hidden <mailto:address@hidden>> wrote:

    Hi John,

    I'm trying to set a proxy host and port for matlab 2008b and
    SNCTOOLS.  I've verified that the installation works when the
    proxy server is turned off, but it fails when the proxy server
    is turned on.

    So I've tried to set the proxy host and port in Matlab
    preferences, no change, software fails to make connection with
    THREDDS server.  I've tried to set the
    java.lang.System.setProperties('http.proxyHost','<http://proxyhostname>')
    and the
    java.lang.System.setProperties('http.proxyPort','<portNumber>'),
    but that fails too.

    I can reach the THREDDS site with a web browser, but not with
    the Matlab and toolbox.  Yes the web browser has the proxy
    server correctly set, but the matlab/toolbox/java software fails
    to complete a request until it timeout.  It seems like MATLAB or
    java is not talking to the proxy server.

    Can you shed any light or help on solving the proxy server problem?

    Regards,

     - Tim Pugh -




--
John Evans


--
James Gallagher
jgallagher at opendap.org
406.723.8663