gabrieldoty / simplify-scorm

Scorm 1.2 Javascript API
MIT License
229 stars 77 forks source link

Scorm Proxy #49

Open mauricioss777 opened 6 months ago

mauricioss777 commented 6 months ago

Hello everyone!

I've created a player for SCORM and embedded it into my system. My system is developed in PHP with Laravel and is hosted at myhost.com/player.php. The issue I'm facing is that I've hosted the unpacked SCORM package files in an S3 bucket on Amazon and created a link through CloudFront. When I try to access the SCORM content in the player by pointing to the CloudFront link, several security errors occur. Is there any way to fix this? I've been thinking about implementing a proxy for SCORM and dynamically loading the files. Is there already a solution for this?

Thank you very much!

arashster commented 6 months ago

What security errors are you getting? CORS specifically?

mauricioss777 commented 6 months ago

Yes, CORS. But I guess it is not the unique problem. I've tried to solve this in so many ways that I no longer know exactly what I'm doing. I left logic aside and was already trying and error. The infrastructure team has tried different ways to configure AWS, but nothing seems to work. From what I've been researching, RusticSoftware created a solution for this by placing a proxy between the player and the file server where the scorm courses are located. Have you ever been through something similar?

What I'm trying to do is the following: I have an LSM on an ec2 with a domain mylms.com This LSM has a scorm player that responds like this: mylms.com/player.php?scorm= This player points the iframe to a CloudFront link aws.cloudfront.com/link/to/scorm/content/

The CloudFront link links to an s3 bucket where the scorm course files are available.

When I point to the files locally (within the mylms.com server) everything works. When I point to CloudFront, the browser generates several CORS and Cross-domain errors.

arashster commented 6 months ago

Which web server are you using? Nginx or Apache? You could configure Nginx or Apache2 to proxy the S3 bucket or CloudFront endpoint.

https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/ https://httpd.apache.org/docs/2.4/howto/reverse_proxy.html

This way the content can play on the same domain