OLD | NEW |
1 from mod_pywebsocket import handshake | 1 from mod_pywebsocket import handshake |
2 | 2 |
3 | 3 |
4 def web_socket_do_extra_handshake(request): | 4 def web_socket_do_extra_handshake(request): |
5 msg = "HTTP/1.1 101 WebSocket Protocol Handshake\r\n" | 5 msg = "HTTP/1.1 101 WebSocket Protocol Handshake\r\n" |
6 msg += ("p" * 1024) + "\r\n" | 6 msg += ("p" * 1024) + "\r\n" |
7 msg += "\r\n" | 7 msg += "\r\n" |
8 request.connection.write(msg) | 8 request.connection.write(msg) |
9 raise handshake.AbortedByUserException("Abort the connection") # Prevents py
websocket from sending its own handshake message. | 9 raise handshake.AbortedByUserException("Abort the connection") # Prevents py
websocket from sending its own handshake message. |
10 | 10 |
11 | 11 |
12 def web_socket_transfer_data(request): | 12 def web_socket_transfer_data(request): |
13 pass | 13 pass |
OLD | NEW |