fix wss support for web_monitor_uri

Https support
pull/46/head
Tad Wang 9 years ago
parent d9455e3f9b
commit 6fbb387488

@ -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))

@ -136,8 +136,13 @@
{# })#}
{# });#}
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({

Loading…
Cancel
Save