On Thursday, June 8, 2017 at 7:24:57 AM UTC-7, takowl wrote:
>
> On 8 June 2017 at 04:04, Brendan Barnwell <[email protected] <javascript:>
> > wrote:
>
>> What I would like is the ability to start a notebook server that would 
>> automatically shut down once the associated browser is closed.  Looking at 
>> old messages on the list, I get the impression this isn't possible.  Is 
>> that correct?
>>
>
> With a special-purpose browser that knows about the notebook server, yes - 
> the browser can either use SIGTERM when it closes to shut down the notebook 
> server, or when notebook 5.1 is released, it will be able to POST to 
> /api/shutdown
>
> https://github.com/jupyter/notebook/pull/2507
>
>
In trying to get this to work before the /api/shutdown call is in, I've hit 
a snag.  I thought that I could use list_running_servers and check the auth 
token against the one passed in the URL to match the server process with 
the one that launched the browser.  But I can't, because the token passed 
to the browser is just the one-time token, which isn't stored in the server 
info that's returned from list_running_servers.  So the information that 
would allow me to tell which server process ran the browser is, ironically, 
printed to the console, but not passed to the browser.  Would it be 
possible for the "regular" token to be passed to the browser as well as the 
one-time token?  Or is there some other way for the browser to identify the 
notebook server process that launched it?

I must say I've never fully understood the purpose of the one-time token.  
Is it just so that if the user closes the notebook tab in their browser, 
they can then just navigate to the server URL without having to supply a 
token again?

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/78483aae-14e3-433a-bd13-84ae03a3f2b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to