Comments (6)
Hello,
I know this is a old issue but I am facing a very similar situation with a web server that serves static files. So, I have a web server, say myapp
, that I would like to proxy using Jupyter server proxy. I have integrated it into JupyterLab and I can access it at http://localhost:8888/myapp
URL. The landing page of myapp
has say following content:
<H2>Create new session:</H2>
<FORM action="/session/new.cgi" METHOD=POST>
<INPUT NAME="NEWNAME" VALUE="Session_name">
<INPUT TYPE=SUBMIT VALUE="Create">
<br>
</FORM>
that serves static files. When I click submit
on the page, I am being redirected to http://localhost:8888/session/new.cgi
and end up with 404 error. If I manually navigate to http://localhost:8888/myapp/session/new.cgi
I can access the page without any issues. I have tried using absolute_url
, rewrite_response
without much luck. Is it possible to achieve what I am trying here? If so, any pointer would be appreciated!
Cheers!!
from jupyter-server-proxy.
I noticed absolute_url
in the documentation and wanted to try it. From the documentation, it seems there are two ways to specify the configuration, i.e., traitlets and python packages. I need some help getting either one of those working. Here is my code for python package (I picked the code given in the documentation and tweaked just the command section):
- Put the following code in openrefine.py
def setup_openrefine():
return {
'command': ['python', '-m', 'http.server', '8080']
}
- Created the following setup.py file:
import setuptools
setuptools.setup(
name="jupyter-openrefine-server",
# py_modules rather than packages, since we only have 1 file
py_modules=['openrefine'],
entry_points={
'jupyter_serverproxy_servers': [
# name = packagename:function_name
'openrefine = openrefine:setup_openrefine',
]
},
install_requires=['jupyter-server-proxy'],
)
-
Executed
pip install .
in the folder. -
Tried to browse
http://www.tld.com/user/johndoe/proxy/8080/
andhttp://www.tld.com/user/johndoe/openrefine
without any success.ps -aux
does not show the process running.
What am I missing?
from jupyter-server-proxy.
If you're just getting started it's probably easier to use a configuration file instead of using a Python package which is useful when you've got a working application you want to distribute to others. Have you tried the example in point 4 absolute_url
of Server Process options? Put
c.ServerProxy.servers = {
'test-server': {
'command': ['python3', '-m', 'http.server', '{port}'],
'absolute_url': False
}
}
in ~/jupyter_notebook_config.py
from jupyter-server-proxy.
I tried the traitlets option as well:
- put the following code in
~/.jupyter/jupyter_notebook_config.py
c.ServerProxy.servers = {
'test-server': {
'command': ['python3', '-m', 'http.server', '{port}'],
'absolute_url': False
}
}
- browsed to
http://www.tld.com/user/johndoe/test-server
and also checkedps -aux
. But don't see the command running.
I think I am missing a step to load the configuration (or python package) to trigger the command. Also, I am not sure if the endpoints I am browsing to are correct.
from jupyter-server-proxy.
The first example should take effect as soon as you restart you notebook. http://www.tld.com/user/johndoe/test-server
looks like the correct URL, can you restart your notebook with debug logging?
from jupyter-server-proxy.
I am running jupyterhub environment that spawns docker instance of notebook servers as a user logs in; I think that instance keeps running even when the client browser is terminated. Do I need to restart the notebook instance in the backend? Is there a way to reload the jupyter config without needing the backend access to restart the notebook. Does python package option also require restart?
from jupyter-server-proxy.
Related Issues (20)
- labextension support on jupyterlab >= 4.0 HOT 2
- JupyterLab extension to also be a Notebook 7 extension
- Test failures with JupyterLab 3 - soon resolved upstream HOT 1
- Do we need .yarnrc, or can we always build the extension with jupyterlab 4 that doesn't need it? HOT 3
- Resolve consistent failures related to "address in use" etc HOT 1
- Test suite is failing in main branch
- Test suite failing in our CI system HOT 1
- Error 500 when using Jupyter Server Proxy Arbitrary Ports on a port that is not serving HOT 1
- Handler subprotocol method fails to detect empty list HOT 1
- PDF preview of LaTeX Workshop (code-server) results in `HTTP 400: Bad Request` HOT 4
- Test failures in main branch HOT 4
- WebSocket subprotocols for client/proxy are chosen without asking the server we proxy to HOT 10
- Issue on page /install.html HOT 1
- Consider changing or removing Author field from PyPI
- Require at least tornado 6.1 - a dependency for notebook 6.2+ and jupyterlab 3+
- Open in Panel HOT 3
- `new_browser_tab` is True by default, but documented to be False
- Ability to Configure Activity Reporting HOT 1
- Document `rewrite_response`
- Process management and the ability to start and stop the launched process HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jupyter-server-proxy.