Skip to content

Commit 8846319

Browse files
committed
make streaming ssl aware
1 parent b3a926f commit 8846319

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

plotly/plotlystream.m

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,19 @@
4040
obj.Specs.Host = 'http://stream.plot.ly';
4141
end
4242

43+
%check if ssl is enabled
44+
if any(strfind(obj.Specs.Host,'https://') == 1)
45+
obj.Specs.SSLEnabled = true;
46+
else
47+
obj.Specs.SSLEnabled = false;
48+
end
49+
50+
%add http if not present on host
51+
if ~obj.Specs.SSLEnabled
52+
if ~any(strfind(obj.Specs.Host,'http://') == 1)
53+
obj.Specs.Host = ['http://' obj.Specs.Host];
54+
end
55+
end
4356
%initialize connection settings
4457
obj.Specs.ReconnectOn = {'','200','408'};
4558
obj.Specs.Timeout = 500;
@@ -98,12 +111,6 @@
98111
'online documentation found @ plot.ly/matlab for more information or contact ',...
99112
100113
end
101-
102-
%add http if not present on host
103-
if ~any(strfind(obj.Specs.Host,'http://') == 1)
104-
obj.Specs.Host = ['http://' obj.Specs.Host];
105-
end
106-
107114
end
108115

109116
%-----------OPEN STREAM-----------%

0 commit comments

Comments
 (0)