Skip to content
This repository

doc improvements for running notebook via secure protocol #730

Merged
merged 3 commits into from over 2 years ago

3 participants

Satrajit Ghosh Fernando Perez Brian E. Granger
Satrajit Ghosh

No description provided.

IPython/frontend/html/notebook/notebookapp.py
@@ -263,7 +263,12 @@ class IPythonNotebookApp(BaseIPythonApplication):
263 263
 
264 264
     def start(self):
265 265
         ip = self.ip if self.ip else '[all ip addresses on your system]'
266  
-        self.log.info("The IPython Notebook is running at: http://%s:%i" % (ip, self.port))
  266
+        proto = 'http'
  267
+        if self.certfile:
  268
+            proto = 'https'
  269
+        self.log.info("The IPython Notebook is running at: %s://%s:%i" % (proto,
1
Fernando Perez Owner
fperez added a note August 25, 2011

Since we're on 2.6, this can be more compactly written in the new form:

proto = 'https' if self.certfile else 'http'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Fernando Perez
Owner

This is great, thanks! Once this minor fix is made, I'll go ahead and merge.

Brian E. Granger ellisonbg merged commit e9402c0 into from August 25, 2011
Brian E. Granger ellisonbg closed this August 25, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
5  IPython/frontend/html/notebook/notebookapp.py
@@ -263,7 +263,10 @@ def initialize(self, argv=None):
263 263
 
264 264
     def start(self):
265 265
         ip = self.ip if self.ip else '[all ip addresses on your system]'
266  
-        self.log.info("The IPython Notebook is running at: http://%s:%i" % (ip, self.port))
  266
+        proto = 'https' if self.certfile else 'http'
  267
+        self.log.info("The IPython Notebook is running at: %s://%s:%i" % (proto,
  268
+                                                                          ip,
  269
+                                                                          self.port))
267 270
         ioloop.IOLoop.instance().start()
268 271
 
269 272
 #-----------------------------------------------------------------------------
13  docs/source/interactive/htmlnotebook.txt
@@ -26,8 +26,19 @@ you want inline figures, you must manually select the ``inline`` backend::
26 26
 
27 27
     $ ipython notebook --pylab=inline
28 28
 
  29
+You can start the notebook to communicate via a secure protocol mode using a
  30
+self-signed certificate by typing::
  31
+
  32
+    $ ipython notebook --certfile=mycert.pem
  33
+
  34
+.. note::
  35
+
  36
+    A self-signed certificate can be generated with openssl. For example:
  37
+
  38
+    openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem
  39
+
29 40
 This server uses the same ZeroMQ-based two process kernel architecture as
30  
-the QT Console as well Tornado for serving HTTP requests. Some of the main
  41
+the QT Console as well Tornado for serving HTTP/S requests. Some of the main
31 42
 features of the Notebook include:
32 43
 
33 44
 * Display rich data (png/html/latex/svg) in the browser as a result of
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.