forked from novnc/noVNC
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for SSL/TLS ('wss://') on both sides.
On the client side, this adds the as3crypto library to web-socket-js so that the WebSocket 'wss://' scheme is supported which is WebSocket over SSL/TLS. Couple of downsides to the fall-back method: - This balloons the size of the web-socket-js object from about 12K to 172K. - Getting it working required disabling RFC2718 web proxy support in web-socket-js. - It makes the web-socket-js fallback even slower with the encryption overhead. The server side (wsproxy.py) uses python SSL support. The proxy automatically detects the type of incoming connection whether flash policy request, SSL/TLS handshake ('wss://') or plain socket ('ws://'). Also added a check-box to the web page to enable/disabled 'wss://' encryption.
- Loading branch information
Showing
11 changed files
with
148 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
- Add WSS/https/SSL support to page and wsproxy.py | ||
|
||
- Make C version of wsproxy.py | ||
|
||
- Implement UI option for VNC shared mode. | ||
|
||
- Upgrade to protocol 3.8 | ||
- implement ZRLE encoding | ||
|
||
- Get web-socket-js RFC2817 proxying working again. |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
flash-src/WebSocketMain.swf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../as3crypto_patched/src/com/hurlant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Canvas Browser Compatibility: | ||
http://philip.html5.org/tests/canvas/suite/tests/results.html | ||
|
||
WebSockets API standard: | ||
http://dev.w3.org/html5/websockets/ | ||
|
||
Browser Keyboard Events detailed: | ||
http://unixpapa.com/js/key.html | ||
|
||
ActionScript (Flash) WebSocket implementation: | ||
http://github.com/gimite/web-socket-js | ||
|
||
ActionScript (Flash) crypto/TLS library: | ||
http://code.google.com/p/as3crypto | ||
http://github.com/lyokato/as3crypto_patched | ||
|
||
TLS Protocol: | ||
http://en.wikipedia.org/wiki/Transport_Layer_Security | ||
|
||
Generate self-signed certificate: | ||
http://docs.python.org/dev/library/ssl.html#certificates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/usr/bin/python | ||
''' | ||
A super simple HTTP/HTTPS webserver for python. Automatically detect | ||
You can make a cert/key with openssl using: | ||
openssl req -new -x509 -days 365 -nodes -out self.pem -keyout self.pem | ||
as taken from http://docs.python.org/dev/library/ssl.html#certificates | ||
''' | ||
|
||
import traceback, sys | ||
import socket | ||
import ssl | ||
#import http.server as server # python 3.X | ||
import SimpleHTTPServer as server # python 2.X | ||
|
||
def do_request(connstream, from_addr): | ||
x = object() | ||
server.SimpleHTTPRequestHandler(connstream, from_addr, x) | ||
|
||
def serve(): | ||
bindsocket = socket.socket() | ||
#bindsocket.bind(('localhost', PORT)) | ||
bindsocket.bind(('', PORT)) | ||
bindsocket.listen(5) | ||
|
||
print("serving on port", PORT) | ||
|
||
while True: | ||
try: | ||
newsocket, from_addr = bindsocket.accept() | ||
peek = newsocket.recv(1024, socket.MSG_PEEK) | ||
if peek.startswith("\x16"): | ||
connstream = ssl.wrap_socket( | ||
newsocket, | ||
server_side=True, | ||
certfile='self.pem', | ||
ssl_version=ssl.PROTOCOL_TLSv1) | ||
else: | ||
connstream = newsocket | ||
|
||
do_request(connstream, from_addr) | ||
|
||
except Exception: | ||
traceback.print_exc() | ||
|
||
try: | ||
PORT = int(sys.argv[1]) | ||
except: | ||
print "%s port" % sys.argv[0] | ||
sys.exit(2) | ||
|
||
serve() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters