-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
CORS configuration #56
Comments
Yeah, so it looks like you'd need to add some middleware here to set up your CORs stuff. This should probably be handled by the application out of the box. But in the mean time, I think you need A new function here: func corsMiddleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// TODO see https://github.com/GoogleCloudPlatform/golang-samples/blob/master/functions/http/cors.go#L29-L39
next.ServeHTTP(w, r)
})
} And then add it to the middlware chain here
There's also this library which appears to be a little more turn-key but I haven't used it before. I'll leave this open to remind myself to look more into providing better support for this in the future. |
Can confirm that this solution works, thanks again. |
@jaredpetersen When do you think you will implement it in the raspilive? |
Eventually 🤷♂️ I've been taking a small break from open source to catch up on other hobbies. Is there an urgent need? |
Oh sure, no I think it is also solvable with a reverse proxy in front of the stream. |
First off, thanks for creating raspilive, it saved me a lot of time setting similar solution.
I have a bit of a problem with connecting served file with web app I've created because of a CORS error. I guess I need to set Access-Control-Allow-Origin to my website address. Can you point me to the direction where should I change the server configuration to edit its CORS headers?
I have zero GOlang experience but I'm willing to learn anything
Thanks a lot.
The text was updated successfully, but these errors were encountered: