Don't try to connect to a non-existent WebSocket server on location.host:80.

This commit is contained in:
Ms2ger 2015-06-20 17:10:47 +02:00
parent 02303941be
commit deef342ed8

View file

@ -5,9 +5,14 @@
<script src=../constants.js?pipe=sub></script> <script src=../constants.js?pipe=sub></script>
<div id=log></div> <div id=log></div>
<script> <script>
var tests = ['ws:', 'ws:/', 'wss:', 'wss:/']; var tests = [
['ws:', PORT],
['ws:/', PORT],
['wss:', PORT_SSL],
['wss:/', PORT_SSL]
];
//Pass condition is to not throw //Pass condition is to not throw
for (var i = 0; i < tests.length; ++i) { for (var i = 0; i < tests.length; ++i) {
test(function(){new WebSocket(tests[i]+location.host+'/echo')}, tests[i]); test(function(){new WebSocket(tests[i][0] + location.host + ':' + tests[i][1] + '/echo')}, tests[i][0]);
} }
</script> </script>