Author: markt
Date: Sat Jun 16 21:40:17 2012
New Revision: 1351011

URL: http://svn.apache.org/viewvc?rev=1351011&view=rev
Log:
Fix the WebSocket examples so the work with secure as well as non-secure 
connections.

Modified:
    tomcat/tc7.0.x/trunk/   (props changed)
    tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
    tomcat/tc7.0.x/trunk/webapps/examples/websocket/chat.html
    tomcat/tc7.0.x/trunk/webapps/examples/websocket/echo.html
    tomcat/tc7.0.x/trunk/webapps/examples/websocket/snake.html

Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
  Merged /tomcat/trunk:r1351010

Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1351011&r1=1351010&r2=1351011&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Sat Jun 16 21:40:17 2012
@@ -55,10 +55,17 @@
 -->
 <section name="Tomcat 7.0.29 (markt)">
   <subsection name="Catalina">
-      <fix>
-        Fix checking of recommended tcnative library version
-        when using the APR connector. (rjung)
-      </fix>
+    <fix>
+      Fix checking of recommended tcnative library version when using the APR
+      connector. (rjung)
+    </fix>
+  </subsection>
+  <subsection name="Web applications">
+    <fix>
+      Update the WebSocket examples in the examples web application so that 
they
+      work with secure connections (wss) as well as non-secure (ws) 
connections.
+      (markt)  
+    </fix>
   </subsection>
 </section>
 <section name="Tomcat 7.0.28 (markt)">

Modified: tomcat/tc7.0.x/trunk/webapps/examples/websocket/chat.html
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/examples/websocket/chat.html?rev=1351011&r1=1351010&r2=1351011&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/examples/websocket/chat.html (original)
+++ tomcat/tc7.0.x/trunk/webapps/examples/websocket/chat.html Sat Jun 16 
21:40:17 2012
@@ -77,7 +77,11 @@
         });
 
         Chat.initialize = function() {
-            Chat.connect('ws://' + window.location.host + 
'/examples/websocket/chat');
+            if (window.location.protocol == 'http:') {
+                Chat.connect('ws://' + window.location.host + 
'/examples/websocket/chat');
+            } else {
+               Chat.connect('wss://' + window.location.host + 
'/examples/websocket/chat');
+            }
         };
 
         Chat.sendMessage = (function() {

Modified: tomcat/tc7.0.x/trunk/webapps/examples/websocket/echo.html
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/examples/websocket/echo.html?rev=1351011&r1=1351010&r2=1351011&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/examples/websocket/echo.html (original)
+++ tomcat/tc7.0.x/trunk/webapps/examples/websocket/echo.html Sat Jun 16 
21:40:17 2012
@@ -104,7 +104,11 @@
         }
 
         function updateTarget(target) {
-            document.getElementById('target').value = 'ws://' + 
window.location.host + target;
+               if (window.location.protocol == 'http:') {
+                   document.getElementById('target').value = 'ws://' + 
window.location.host + target;
+               } else {
+                       document.getElementById('target').value = 'wss://' + 
window.location.host + target;
+               }
         }
 
         function log(message) {

Modified: tomcat/tc7.0.x/trunk/webapps/examples/websocket/snake.html
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/examples/websocket/snake.html?rev=1351011&r1=1351010&r2=1351011&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/examples/websocket/snake.html (original)
+++ tomcat/tc7.0.x/trunk/webapps/examples/websocket/snake.html Sat Jun 16 
21:40:17 2012
@@ -109,7 +109,11 @@
                     }
                 }
             }, false);
-            Game.connect('ws://' + window.location.host + 
'/examples/websocket/snake');
+            if (window.location.protocol == 'http:') {
+                Game.connect('ws://' + window.location.host + 
'/examples/websocket/snake');
+            } else {
+               Game.connect('wss://' + window.location.host + 
'/examples/websocket/snake');
+            }
         };
 
         Game.setDirection  = function(direction) {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to