Skip to content

Instantly share code, notes, and snippets.

@rgbkrk
Last active July 20, 2016 20:36
Show Gist options
  • Save rgbkrk/dc786c0fa0d12636c9b290e6380dc866 to your computer and use it in GitHub Desktop.
Save rgbkrk/dc786c0fa0d12636c9b290e6380dc866 to your computer and use it in GitHub Desktop.
notebook config for cross origin
c = get_config()
c.NotebookApp.ip='*'
c.NotebookApp.port = 8888
c.NotebookApp.open_browser = False
# Allow any set of ports, used below with localhost
port_digits = '(?::\d{1,5})?'
pat = '^(?:' + '|'.join([
# Allow localhost on all ports to use, regardless of HTTP vs HTTPS
'(?:https?://(?:localhost|127.0.0.1)' + port_digits + ')',
# Allow lambdaops unfettered access
'https://lambdaops.com',
# Any tmpnb domain
'https://.*\.tmpnb.org'
]) + ')$'
c.NotebookApp.allow_origin_pat = pat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment