##// END OF EJS Templates
pass ws_url to kernel constructor...
MinRK -
Show More
@@ -59,6 +59,7 define([
59 59 this.keyboard_manager = options.keyboard_manager;
60 60 this.save_widget = options.save_widget;
61 61 this.tooltip = new tooltip.Tooltip(this.events);
62 this.ws_url = options.ws_url;
62 63 // default_kernel_name is a temporary measure while we implement proper
63 64 // kernel selection and delayed start. Do not rely on it.
64 65 this.default_kernel_name = 'python';
@@ -1496,6 +1497,7 define([
1496 1497 Notebook.prototype.start_session = function () {
1497 1498 this.session = new session.Session({
1498 1499 base_url: this.base_url,
1500 ws_url: this.ws_url,
1499 1501 notebook_path: this.notebook_path,
1500 1502 notebook_name: this.notebook_name,
1501 1503 // For now, create all sessions with the 'python' kernel, which is the
@@ -15,7 +15,7 define([
15 15 * A Kernel Class to communicate with the Python kernel
16 16 * @Class Kernel
17 17 */
18 var Kernel = function (kernel_service_url, notebook, name) {
18 var Kernel = function (kernel_service_url, ws_url, notebook, name) {
19 19 this.events = notebook.events;
20 20 this.kernel_id = null;
21 21 this.shell_channel = null;
@@ -23,7 +23,7 define([
23 23 this.stdin_channel = null;
24 24 this.kernel_service_url = kernel_service_url;
25 25 this.name = name;
26 this.ws_url = IPython.utils.get_body_data("wsUrl");
26 this.ws_url = ws_url || IPython.utils.get_body_data("wsUrl");
27 27 if (!this.ws_url) {
28 28 // trailing 's' in https will become wss for secure web sockets
29 29 this.ws_url = location.protocol.replace('http', 'ws') + "//" + location.host;
@@ -17,6 +17,7 define([
17 17 this.path = options.notebook_path;
18 18 this.kernel_name = options.kernel_name;
19 19 this.base_url = options.base_url;
20 this.ws_url = options.ws_url;
20 21 };
21 22
22 23 Session.prototype.start = function(callback) {
@@ -91,7 +92,7 define([
91 92 Session.prototype._handle_start_success = function (data, status, xhr) {
92 93 this.id = data.id;
93 94 var kernel_service_url = utils.url_path_join(this.base_url, "api/kernels");
94 this.kernel = new kernel.Kernel(kernel_service_url, this.notebook, this.kernel_name);
95 this.kernel = new kernel.Kernel(kernel_service_url, this.ws_url, this.notebook, this.kernel_name);
95 96 this.kernel._kernel_started(data.kernel);
96 97 };
97 98
General Comments 0
You need to be logged in to leave comments. Login now