-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make WebSocket URL relative to path on which RustPad itself is served #78
Conversation
Hm, can you give an example of where it would be served on a subpath? Is this something supported by reverse proxies / did it come up for you? |
Yes, all reverse proxies I’ve ever used allow adding rules along the lines of forwarding |
I needed one more patch to make Vite’s build output use relative links, but not everything (all patches) appear to work. See final version here if you’re curious: |
Nice, great stuff. Is there a reason you wouldn't just forward /rustpad/:path to localhost:3000/:path? |
7dce34b
to
b534201
Compare
@ekzhang: I’m not following unfortunately, why would I forward serving the web client package to the API server? |
There are not two separate servers, intended deployment method is just one server for API routes and static files. That's how the Dockerfile works! |
The path stays the same in all currently supported scenarios, but this also allows serving the app from a subpath.
b534201
to
4854ae3
Compare
Ok, I never looked at either the Dockerfile nor the rustpad-server code. If I understand the server code correctly it also serves up static files from a local directory named I just assumed I need to server static files separately since that is how all server software I know (which is mostly Python) works. In my current deployment scenario the frontend is also built independently from the server component (I managed to build the web and server components in a smart way now, but they end up in two unrelated packages/derivations only sharing the Cargo dependencies), so it doesn’t make much sense to combine the two if one can just define 2 routes in the web server that is already required for TLS termination… More importantly, this is all besides the point anyways since I could have just written this instead and it would still name the same issue that this patch solves:
Whether static files are served by the web server or the rustpad server isn’t relevant to this issue at all. |
This isn't how the Jupyter server works, for instance. No worries though |
I think this makes sense, thank you! |
The path stays the same in all currently supported scenarios, but this also allows serving the app from a subpath.