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

Add an option to disable CORS proxy #44

Open
juhana opened this issue Jul 27, 2020 · 2 comments
Open

Add an option to disable CORS proxy #44

juhana opened this issue Jul 27, 2020 · 2 comments

Comments

@juhana
Copy link
Contributor

juhana commented Jul 27, 2020

Quixe automatically uses a proxy to download the story file if it detects that it's not on the same domain. There are two cases where the proxy makes things worse rather than better:

  1. The file is on a different domain, but the server sets the correct CORS headers so it works without the proxy. The file might be inaccessible to the proxy (localhost, internal network etc.)
  2. The URL is a data URL (data:...)

A workaround is to load the story file manually and pass it to GiLoad.load_run() to start the game.

Arguably case 2 is a bug and it should detect data URLs, but for case 1 we'd need either that setting the proxy URL option to null would disable it altogether, or a separate setting that disables the proxy. Preferably with options auto-detection (current behavior), always enabled or always disabled. HugoJS has this setting:

// use a CORS proxy to load game files?
// "always" (or true), "never" (or false), or "auto".
// The "auto" option uses proxy only if the story URL points to another domain.
use_proxy: "auto"

(For reference, same issue posted to Parchment: curiousdannii/parchment#71)

@erkyrath
Copy link
Owner

This makes sense to me. Can you write a PR, or should I try it?

@juhana
Copy link
Contributor Author

juhana commented Jul 27, 2020

@curiousdannii said he's going to rewrite this part for Parchment, maybe wait for that so we'll get similar interfaces for both interpreters? I can then use it to make a PR for Quixe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants