##// END OF EJS Templates
specify socket identity from kernel.js...
MinRK -
Show More
@@ -507,6 +507,12 b' class AuthenticatedZMQStreamHandler(ZMQStreamHandler, IPythonHandler):'
507 # under Python 2.x for some reason
507 # under Python 2.x for some reason
508 msg = msg.encode('utf8', 'replace')
508 msg = msg.encode('utf8', 'replace')
509 try:
509 try:
510 bsession, msg = msg.split(':', 1)
511 self.session.session = bsession.decode('ascii')
512 except Exception:
513 logging.error("No bsession!", exc_info=True)
514 pass
515 try:
510 self.request._cookies = Cookie.SimpleCookie(msg)
516 self.request._cookies = Cookie.SimpleCookie(msg)
511 except:
517 except:
512 self.log.warn("couldn't parse cookie string: %s",msg, exc_info=True)
518 self.log.warn("couldn't parse cookie string: %s",msg, exc_info=True)
@@ -528,7 +534,7 b' class ZMQChannelHandler(AuthenticatedZMQStreamHandler):'
528 def create_stream(self):
534 def create_stream(self):
529 km = self.kernel_manager
535 km = self.kernel_manager
530 meth = getattr(km, 'connect_%s' % self.channel)
536 meth = getattr(km, 'connect_%s' % self.channel)
531 self.zmq_stream = meth(self.kernel_id)
537 self.zmq_stream = meth(self.kernel_id, identity=self.session.bsession)
532
538
533 def initialize(self, *args, **kwargs):
539 def initialize(self, *args, **kwargs):
534 self.zmq_stream = None
540 self.zmq_stream = None
@@ -129,7 +129,7 b' var IPython = (function (IPython) {'
129 this.shell_channel = new this.WebSocket(ws_url + "/shell");
129 this.shell_channel = new this.WebSocket(ws_url + "/shell");
130 this.iopub_channel = new this.WebSocket(ws_url + "/iopub");
130 this.iopub_channel = new this.WebSocket(ws_url + "/iopub");
131 send_cookie = function(){
131 send_cookie = function(){
132 this.send(document.cookie);
132 this.send(that.session_id + ':' + document.cookie);
133 };
133 };
134 var already_called_onclose = false; // only alert once
134 var already_called_onclose = false; // only alert once
135 var ws_closed_early = function(evt){
135 var ws_closed_early = function(evt){
General Comments 0
You need to be logged in to leave comments. Login now