The jupyter server operates on the loopback interface which has IP address 
127.0.0.1 and IP name localhost.  The cocoserver uses that same interface.  
Jupyter tries to get port 8888 and if that is busy it hunts for a nearby 
port that is not in use.   The cocoserver uses an arbitrary system-assigned 
available port in the public range (above 1000).

I don't see what difference the choice of port makes to a user.  It is not 
possible to guarantee that the same port will always be used, since ports 
are assigned on a first-come first-served basis.  Consequently it is not 
possible to "bookmark" the address of either a jupyter server or a 
cocoserver.  The port should be viewed as arbitrary and unpredictable.  The 
address is always 127.0.0.1 in either case, by necessity.

- Marc

On Friday, April 26, 2024 at 4:05:12 PM UTC-5 Nils Bruin wrote:

> On Friday 26 April 2024 at 12:29:14 UTC-7 marc....@gmail.com wrote:
>
> There are other issues with viewing local documentation files in a 
> browser.  On Ubuntu, Chrome and Firefox are packaged as snaps.  A snap is 
> not allowed to read a file:// url which is not in the user's home 
> directory.  As long as sage is installed in the user's home directory this 
> is not an issue.  But if the documentation is elsewhere then Firefox and 
> Chrome will refuse to show it.  Using the cocoserver works around this 
> because it is allowed to use a url with the loopback interface as the host 
> address.  (I think it is safer to use 127.0.0.1 instead of localhost 
> because, in principle, a rogue DNS server would be able to provide any IP 
> address as an A record for localhost). 
>
>
> The most flexible would be to serve it from would be whatever address the 
> jupyter server is serving on. That's why it might be easier to get this to 
> behave properly as a jupyter extension, because it could even serve it on 
> the same port in that case. I guess the OSX app has hardcoded that it 
> serves on 127.0.0.1 then? How do you work around port availability there? 
> Does coco listen on a separate port from the jupyter server?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/a0cc2634-605d-4479-be1b-a7dc4171050an%40googlegroups.com.

Reply via email to