summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBrandon Stafford <brandon@rascalmicro.com>2013-07-22 15:22:44 -0400
committerBrandon Stafford <brandon@rascalmicro.com>2013-07-22 15:22:44 -0400
commit317b0f79a8e6e74380de54d4bbc379e91602bacf (patch)
treec1b7be950cd5ec86407eb13e43d311aed8ca69b1 /tests
parent464457827696e8b345193ffc64649bb49b9f3d01 (diff)
downloaduwsgi-317b0f79a8e6e74380de54d4bbc379e91602bacf.tar.gz
Convert tabs to spaces to fix indentation error
The uwsgi.websocket_handshake call on line 52 was not indented properly, causing the Python interpreter to choke. Converting the few tabs sprinkled through the document to spaces fixes that error.
Diffstat (limited to 'tests')
-rw-r--r--tests/websockets_echo.py34
1 files changed, 17 insertions, 17 deletions
diff --git a/tests/websockets_echo.py b/tests/websockets_echo.py
index 19e791df..c3b50765 100644
--- a/tests/websockets_echo.py
+++ b/tests/websockets_echo.py
@@ -3,11 +3,11 @@ import uwsgi
import time
def application(env, sr):
-
+
ws_scheme = 'ws'
if 'HTTPS' in env or env['wsgi.url_scheme'] == 'https':
ws_scheme = 'wss'
-
+
if env['PATH_INFO'] == '/':
sr('200 OK', [('Content-Type','text/html')])
return """
@@ -20,19 +20,19 @@ def application(env, sr):
s.send("ciao");
};
s.onmessage = function(e) {
- var bb = document.getElementById('blackboard')
- var html = bb.innerHTML;
- bb.innerHTML = html + '<br/>' + e.data;
+ var bb = document.getElementById('blackboard')
+ var html = bb.innerHTML;
+ bb.innerHTML = html + '<br/>' + e.data;
};
-
- s.onerror = function(e) {
- alert(e);
- }
-
- s.onclose = function(e) {
- alert("connection closed");
- }
-
+
+ s.onerror = function(e) {
+ alert(e);
+ }
+
+ s.onclose = function(e) {
+ alert("connection closed");
+ }
+
function invia() {
var value = document.getElementById('testo').value;
s.send(value);
@@ -43,13 +43,13 @@ def application(env, sr):
<h1>WebSocket</h1>
<input type="text" id="testo"/>
<input type="button" value="invia" onClick="invia();"/>
- <div id="blackboard" style="width:640px;height:480px;background-color:black;color:white;border: solid 2px red;overflow:auto">
- </div>
+ <div id="blackboard" style="width:640px;height:480px;background-color:black;color:white;border: solid 2px red;overflow:auto">
+ </div>
</body>
</html>
""" % (ws_scheme, env['HTTP_HOST'])
elif env['PATH_INFO'] == '/foobar/':
- uwsgi.websocket_handshake(env['HTTP_SEC_WEBSOCKET_KEY'], env.get('HTTP_ORIGIN', ''))
+ uwsgi.websocket_handshake(env['HTTP_SEC_WEBSOCKET_KEY'], env.get('HTTP_ORIGIN', ''))
print "websockets..."
while True:
msg = uwsgi.websocket_recv()