File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 130130 % -----------CONNECT TO STREAM-----------%
131131 function obj = connect(obj )
132132 obj.URL = java .net .URL([],obj .Specs .Host ,obj .Specs .Handler );
133- obj.Connection = obj .URL .openConnection ; % throws an I/O exception
133+
134+ % Get the proxy information using MathWorks facilities for unified proxy
135+ % preference settings.
136+ mwtcp = com .mathworks .net .transport .MWTransportClientPropertiesFactory .create();
137+ proxy = mwtcp .getProxy();
138+
139+ % Open a connection to the URL.
140+ if isempty(proxy )
141+ obj.Connection = obj .URL .openConnection(); % throws an I/O exception
142+ else
143+ obj.Connection = obj .URL .openConnection(proxy ); % throws an I/O exception
144+ end
145+
134146 obj .Connection .setChunkedStreamingMode(obj .Specs .Chunklen )
135147 obj .Connection .setRequestMethod(' POST' );
136148 obj .Connection .setDoOutput(true );
You can’t perform that action at this time.
0 commit comments