ipywidgets_server icon indicating copy to clipboard operation
ipywidgets_server copied to clipboard

why localhost not work & 127.0.0.1 work ??

Open IamViditAgarwal opened this issue 7 years ago • 5 comments
trafficstars

Hi , In your widget you have mentioned that for loading the widget user needs to enter the url like http://127.0.0.1:8866 , I wonder why localhost not works instead for 127.0.0.1 ? I tried entering url like http://localhost:8866 , It give me following error : serverconnection.js:172 GET http://localhost:8866/api/kernelspecs?1541748996695 403 (Forbidden)
If I want to host this application on my secure domain , would it be possible that this work ?

IamViditAgarwal avatar Nov 09 '18 07:11 IamViditAgarwal

See also https://github.com/pbugnion/ipywidgets_server/issues/37

astrojuanlu avatar Nov 22 '18 11:11 astrojuanlu

Try:

diff --git a/ipywidgets_server/app.py b/ipywidgets_server/app.py
index fb4b6e9..ae66b01 100644
--- a/ipywidgets_server/app.py
+++ b/ipywidgets_server/app.py
@@ -187,7 +187,8 @@ class WidgetsServer(Application):
         app = tornado.web.Application(
             handlers,
             kernel_manager=kernel_manager,
-            kernel_spec_manager=kernel_spec_manager
+            kernel_spec_manager=kernel_spec_manager,
+            allow_remote_access=True,
         )
         app.listen(self.port)
         self.log.info(f'Ipywidgets server listening on port {self.port}.')

astrojuanlu avatar Nov 22 '18 12:11 astrojuanlu

This is great! @Juanlu001 A PR for this would be super useful! Initially just setting allow_remote_access to True would be enough. Later on, we could expose it as a configuration parameter.

pbugnion avatar Nov 23 '18 08:11 pbugnion

Hi @pbugnion! I was not sure if the project was still maintained :) I am using it a lot for a freelance job so I'm pushing some updates to my fork, I will contribute them back when things have settled in a couple of weeks (I will try to take care of https://github.com/pbugnion/ipywidgets_server/issues/36 as well)

astrojuanlu avatar Nov 23 '18 14:11 astrojuanlu

I was not sure if the project was still maintained

That's a valid question. I've just opened issue #48 to discuss this.

pbugnion avatar Nov 26 '18 08:11 pbugnion