We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
auth_doc in crates/y-sweet/src/server.rs generate url & baseUrl, when url_prefix has path, the return url is wrong (baseUrl is correct).
auth_doc
url_prefix
url
for example, when start y-sweet like this:
y-sweet serve --url-prefix=http://localhost/doc/ws/
auth_doc response will be like this:
url: ws://localhost/d/<doc_id>/ws
base_url: http://localhost/doc/ws/d/<doc_id>
maybe remove the prefix slash can fix it? url = url.join(&format!("/d/{doc_id}/ws")).unwrap();
url = url.join(&format!("/d/{doc_id}/ws")).unwrap();
let url = if let Some(url_prefix) = &server_state.url_prefix { let mut url = url_prefix.clone(); let scheme = if url.scheme() == "https" { "wss" } else { "ws" }; url.set_scheme(scheme).unwrap(); url = url.join(&format!("/d/{doc_id}/ws")).unwrap(); url.to_string() } else { format!("ws://{host}/d/{doc_id}/ws") }; let base_url = if let Some(url_prefix) = &server_state.url_prefix { let mut url_prefix = url_prefix.to_string(); if !url_prefix.ends_with('/') { url_prefix = format!("{url_prefix}/"); } format!("{url_prefix}d/{doc_id}") } else { format!("http://{host}/d/{doc_id}") };
I meet this when I try the example deployment. I make some hack like this:
--- a/deploy/Caddyfile +++ b/deploy/Caddyfile @@ -1,5 +1,5 @@ http://localhost { - reverse_proxy /doc/ws/* y-sweet:8080 + reverse_proxy /d/* y-sweet:8080 reverse_proxy /* demos:3000 }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
auth_doc
in crates/y-sweet/src/server.rs generate url & baseUrl,when
url_prefix
has path, the returnurl
is wrong (baseUrl is correct).for example, when start y-sweet like this:
y-sweet serve --url-prefix=http://localhost/doc/ws/
auth_doc response will be like this:
url: ws://localhost/d/<doc_id>/ws
base_url: http://localhost/doc/ws/d/<doc_id>
src of url & base_url
I meet this when I try the example deployment.
I make some hack like this:
The text was updated successfully, but these errors were encountered: