A small change to Matthew's code was needed to make it work. In
urlread.m, change/add the following:
% Open a connection to the URL.
urlConnection = url.openConnection;
password = 'username:password';
encodedPassword =
org.apache.axis.encoding.Base64.encode(double(password));
myPwd = ['Basic ' encodedPassword.toCharArray'];
urlConnection.setRequestProperty('Proxy-Authorization',myPwd);
>
> We don't have this sort of proxy, so I can't test it out. Let us
> know how it works and I'll see about rolling this fix into the
> shipping version.
I am behind a proxy which requires authorisation, and modifying
urlread.m as above works for me.
Matthew Simoneau wrote:
>
>
> I don't think you what the "http://"
> refix when you specify your proxy server in the preferences.
>
> What version of MATLAB are you using? I think we've only been
> shipping the Axis classes since R14sp1. If you're on an older
> version, you'll have to find another encoder. You may be able to
> use
> the undocumented classes in Sun's JVM. Try this:
>
> % Open a connection to the URL.
> urlConnection = url.openConnection;
> password = 'username:password';
> encoder = sun.misc.BASE64Encoder;
> encodedPassword = encoder.encode(double(password));
> myPwd = ['Basic ' encodedPassword.toCharArray'];
> urlConnection.setRequestProperty('Proxy-Authorization',myPwd);
>
> Does this work?
Hi Matthew,
it is R14. I authored the file and it seemed to work although it did
hang the machine a few times. Thanks for all the advice. Is it easy
to connect to yahoo finance (for example) and drag down the market
information? I wish to run this function file for time-series data
analysis.
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Terms prior to use.