Frank Kobzik has posted comments on this change. Change subject: engine: [WIP] Integrate noVNC support ......................................................................
Patch Set 5: (19 inline comments) .................................................... File backend/manager/modules/root/src/main/webapp/vnc_ovirt.html Line 19: src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script> Line 20: --> Line 21: Line 22: <script>var INCLUDE_URI="novnc/include/";</script> Line 23: <script src="novnc/include/vnc.js"></script> Done Line 24: <link rel="stylesheet" href="novnc/include/base.css" title="plain"> Line 25: </head> Line 26: Line 27: <body style="margin: 0px;"> Line 110: Line 111: try{ Line 112: var vncData = JSON.parse(evt.data); Line 113: Line 114: WebUtil.createCookie('connection_data', vncData.connection_data, 1); ok, I've changed this. This data is now passed to the proxy in the url. Line 115: WebUtil.createCookie('signature', vncData.signature, 1); Line 116: Line 117: var vncConnectionData = extractConnectionData(vncData.connection_data); Line 118: Line 116: Line 117: var vncConnectionData = extractConnectionData(vncData.connection_data); Line 118: Line 119: var host = WebUtil.getQueryVar('host', window.location.hostname); Line 120: var port = WebUtil.getQueryVar('port', window.location.port); what do you mean? this host/port identifies the proxy. This information is passed from the server for the client to know where the proxy is... Line 121: var ticket = vncData.ticket; Line 122: Line 123: var path = WebUtil.getQueryVar('path', 'websockify'); Line 124: if ((!host) || (!port)) { .................................................... File backend/manager/modules/root/src/main/webapp/WEB-INF/web.xml Line 76: <servlet-name>novnc</servlet-name> Line 77: <servlet-class>org.ovirt.engine.core.DocsServlet</servlet-class> Line 78: <init-param> Line 79: <param-name>file</param-name> Line 80: <param-value>/usr/share/novnc/</param-value> Done Line 81: </init-param> Line 82: </servlet> Line 83: <servlet-mapping> Line 84: <servlet-name>novnc</servlet-name> Line 81: </init-param> Line 82: </servlet> Line 83: <servlet-mapping> Line 84: <servlet-name>novnc</servlet-name> Line 85: <url-pattern>/novnc/*</url-pattern> Done Line 86: </servlet-mapping> Line 87: Line 88: <!-- SpiceX.cab --> Line 89: <servlet> .................................................... File ovirt-engine.spec.in Line 323: Line 324: %description websocket-proxy Line 325: %{product_name_short} Websocket Proxy Line 326: Line 327: # still TODO later Done Line 328: #j%post websocket-proxy Line 329: #j%if %{install_systemd} Line 330: #j%systemd_post ovirt-websocket-proxy.service fc 18 Line 331: #j%endif .................................................... File packaging/services/ovirt-websocket-proxy.py Line 21: import websockify as wsproxy Line 22: import base64 Line 23: import json Line 24: _ = lambda m: gettext.dgettext(message=m, domain='ovirt-engine') Line 25: Done Line 26: import config Line 27: import service Line 28: Line 29: from M2Crypto import X509 Line 24: _ = lambda m: gettext.dgettext(message=m, domain='ovirt-engine') Line 25: Line 26: import config Line 27: import service Line 28: Done Line 29: from M2Crypto import X509 Line 30: Line 31: ''' Line 32: Websocket proxy for usage with oVirt engine. Line 26: import config Line 27: import service Line 28: Line 29: from M2Crypto import X509 Line 30: Done Line 31: ''' Line 32: Websocket proxy for usage with oVirt engine. Line 33: Leverages wsproxy.py by Joel Martin Line 34: ''' Line 27: import service Line 28: Line 29: from M2Crypto import X509 Line 30: Line 31: ''' Done Line 32: Websocket proxy for usage with oVirt engine. Line 33: Leverages wsproxy.py by Joel Martin Line 34: ''' Line 35: class OvirtWebSocketProxy(wsproxy.WebSocketProxy): Line 34: ''' Line 35: class OvirtWebSocketProxy(wsproxy.WebSocketProxy): Line 36: def __init__(self, *args, **kwargs): Line 37: self.force_data_verification = kwargs.pop('force_data_verification') Line 38: wsproxy.WebSocketProxy.__init__(self, *args, **kwargs) Done Line 39: Line 40: def new_client(self): Line 41: """ Line 42: Called after a new WebSocket connection has been established. Line 41: """ Line 42: Called after a new WebSocket connection has been established. Line 43: """ Line 44: Line 45: cookie = Cookie.SimpleCookie() I've redone this. Now we pull the information from self.path. Line 46: cookie.load(self.headers.getheader('cookie')) Line 47: Line 48: connection_data = cookie['connection_data'].value.split(','); Line 49: signature = cookie['signature'].value Line 60: tsock = self.socket(target_host, target_port, Line 61: connect=True) Line 62: Line 63: if self.verbose and not self.daemon: Line 64: print(self.traffic_legend) Done Line 65: Line 66: # Start proxying Line 67: try: Line 68: self.do_proxy(tsock) Line 63: if self.verbose and not self.daemon: Line 64: print(self.traffic_legend) Line 65: Line 66: # Start proxying Line 67: try: I don't follow this. What is the problem? Line 68: self.do_proxy(tsock) Line 69: except: Line 70: if tsock: Line 71: tsock.shutdown(socket.SHUT_RDWR) Line 75: Line 76: Line 77: class TicketDecoder(object): Line 78: Line 79: def __init__(self, certificate): alright. Line 80: self._key = X509.load_cert( Line 81: certificate, Line 82: X509.FORMAT_PEM, Line 83: ).get_pubkey() Line 141: self._checkInstallation( Line 142: pidfile=self.pidfile, Line 143: ) Line 144: Line 145: self._executable = 'ovirt-websocket-proxy' Done Line 146: Line 147: self._args = [] Line 148: Line 149: def daemonContext(self): Line 143: ) Line 144: Line 145: self._executable = 'ovirt-websocket-proxy' Line 146: Line 147: self._args = [] Done Line 148: Line 149: def daemonContext(self): Line 150: try: Line 151: log = self._config.getBoolean('LOG_FILE') Line 172: target_port='ignore', Line 173: wrap_mode='exit', Line 174: wrap_cmd=None) Line 175: Line 176: server.start_server() Done Line 177: except Exception as inst: Line 178: print inst Line 179: Line 180: Line 174: wrap_cmd=None) Line 175: Line 176: server.start_server() Line 177: except Exception as inst: Line 178: print inst Done Line 179: Line 180: Line 181: if __name__ == '__main__': Line 182: service.setupLogger() -- To view, visit http://gerrit.ovirt.org/13931 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I44e9870b88537360a1886e89c08f18865eae2ef0 Gerrit-PatchSet: 5 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Frank Kobzik <[email protected]> Gerrit-Reviewer: Alon Bar-Lev <[email protected]> Gerrit-Reviewer: Barak Azulay <[email protected]> Gerrit-Reviewer: Frank Kobzik <[email protected]> Gerrit-Reviewer: Itamar Heim <[email protected]> Gerrit-Reviewer: Martin Beták <[email protected]> Gerrit-Reviewer: Michal Skrivanek <[email protected]> Gerrit-Reviewer: Sandro Bonazzola <[email protected]> Gerrit-Reviewer: Tomas Jelinek <[email protected]> Gerrit-Reviewer: Vojtech Szocs <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
