Skip to content
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

Dynamic base-path #479

Closed
alameenlr opened this issue May 18, 2021 · 4 comments
Closed

Dynamic base-path #479

alameenlr opened this issue May 18, 2021 · 4 comments
Labels

Comments

@alameenlr
Copy link

Question
How to sent dynamic basepath?
I've seen on this link https://developers.cloudflare.com/stream/uploading-videos/upload-video-file#nodejs-example

 var options = {
    endpoint: "https://api.cloudflare.com/client/v4/accounts/{ACCOUNT ID}/stream",
    headers: {
      'Authorization': 'Bearer $TOKEN',
    }
     ....
 }

They've added /{ACCOUNT ID}/stream on -base-path , How it is possible?... do you have any option for that?

Setup details
Please provide following details, if applicable to your situation:

  • Operating System: Linux
  • Used tusd version: 1.0
  • Used tusd data storage: AWS S3
  • Used tusd configuration: [-s3-bucket,-s3-endpoint,-s3-object-prefix,-max-size,-timeout,-port,-hooks-http,-hooks-http-retry,-hooks-http-backoff,-hooks-enabled-events ,-behind-proxy]
  • Used tus client library: tus-js-client
@Acconut
Copy link
Member

Acconut commented May 18, 2021

This is not possible with standalone tusd. I am not sure how Cloudflare does it since I am not sure whether they are using tusd or some other tus server. However, in theory you can use a reverse proxy before tusd to rewrite the dynamic URL into a "static" URL pointing to tusd. In addition, the proxy could store the account ID for the URL in a header, which can then by consumed in the hooks for tusd. At least, I think this should work.

@erlendvollset
Copy link

erlendvollset commented May 21, 2021

I have a similar issue. I put put tusd behind ambassador, rewrite the url there, and extract the dynamic parts to put in headers for hooks. But the location header which is returned from POST /upload is then wrong. Would be solved by supporting #332?

@Acconut
Copy link
Member

Acconut commented May 25, 2021

I don't think #332 would help. Since you are already rewriting the URL using a proxy, the easiest approach is likely to also use the proxy to rewrite the Location header.

@Acconut
Copy link
Member

Acconut commented Mar 14, 2023

Closing this issue due to inactivity. Feel free to leave a comment if you want to continue the discussion :)

@Acconut Acconut closed this as completed Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants