R
Railwayβ€’2y ago
DanielBlue

Is TUS protocol supported by Railway?

Greetings! I am building a NodeJS (express) server that you upload files to, which are then uploaded to an AWS S3 bucket. In order to handle large file uploads, the TUS protocol is used. The files are uploaded from an Android app. When the server is running on my local machine, everything seems to be working smoothly, but when I tested it on Railway, I seem to be getting some 301 (moved permanently) status codes. Any clues as to what I could try tinkering with on the Railway config side? (I could provide some code if you think that would help)
Solution:
Since you're getting a 301, are you by chance using a HTTP call instead of HTTPS?
Jump to solution
10 Replies
Percy
Percyβ€’2y ago
Project ID: N/A
DanielBlue
DanielBlueOPβ€’2y ago
N/A
luna
lunaβ€’2y ago
Looks like TUS is just a post + patch + put so I can't see a reason why it wouldn't work. πŸ€”
DanielBlue
DanielBlueOPβ€’2y ago
Indeed. In theory there should not be much to it, so I am going over my configuration to see if I screwed anything up...
Solution
luna
lunaβ€’2y ago
Since you're getting a 301, are you by chance using a HTTP call instead of HTTPS?
Brody
Brodyβ€’2y ago
theres also a 5 minute limit for uploads to the platform, so you might be way better off returning a signed aws s3 URL to the user to upload to
DanielBlue
DanielBlueOPβ€’2y ago
Oh! You seem to have lead me to find the culprit. When I make a request using https, the response header seems to be returning an http location (where all subsequent PATCH calls must be made), so it seems to be the source of my issues. Will tinker a bit around there. @Brody I was not aware of this 5 minute limit. I will have a look at how I could implement this signed URL thing so that users may upload files to my bucket. Thank you!
Brody
Brodyβ€’2y ago
the aws SDK has a function to generate a signed URL, it's super simple, and if your app doesn't actually need to modify the incoming files, it's what you absolutely should be doing
DanielBlue
DanielBlueOPβ€’2y ago
Much obliged. Will take a look at the docs. Thanks to both of you.
Brody
Brodyβ€’2y ago
no problem! πŸ™‚
Want results from more Discord servers?
Add your server