diff --git a/jlog/views.py b/jlog/views.py index ff0eaf1c0..e2565250e 100644 --- a/jlog/views.py +++ b/jlog/views.py @@ -66,7 +66,7 @@ def log_list(request, offset): contact_list, p, contacts, page_range, current_page, show_first, show_end = pages(posts, request) - web_monitor_uri = 'ws://%s/monitor' % WEB_SOCKET_HOST + web_monitor_uri = '%s/monitor' % WEB_SOCKET_HOST web_kill_uri = 'http://%s/kill' % WEB_SOCKET_HOST session_id = request.session.session_key return render_to_response('jlog/log_%s.html' % offset, locals(), context_instance=RequestContext(request)) diff --git a/templates/jlog/log_online.html b/templates/jlog/log_online.html index 14e55f957..f82969156 100644 --- a/templates/jlog/log_online.html +++ b/templates/jlog/log_online.html @@ -136,14 +136,20 @@ {# })#} {# });#} function init(obj){ + var protocol = "ws://"; + if (window.location.protocol == 'https:') { + protocol = 'wss://'; + } + var file_path = obj.attr('file_path'); - var wsUri = '{{ web_monitor_uri }}'; + var wsUri = protocol + '{{ web_monitor_uri }}'; var socket = new WebSocket(wsUri + '?file_path=' + file_path); var term = new Terminal({ - cols: 80, - rows: 24, - screenKeys: false + cols: 80, + rows: 24, + screenKeys: false, + handler: function(){return false} }); var tag = $('
');