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

Set up CORS for stockfish-nnue-16.js #86

Open
muhammadanasajjad opened this issue Dec 20, 2023 · 1 comment
Open

Set up CORS for stockfish-nnue-16.js #86

muhammadanasajjad opened this issue Dec 20, 2023 · 1 comment

Comments

@muhammadanasajjad
Copy link

muhammadanasajjad commented Dec 20, 2023

After having read:
"The full mult-threaded engine:

  • This is best version of the engine but will only run in new browsers with the proper CORS headers applied.

  • Files: stockfish-nnue-16.js & stockfish-nnue-16.wasm"

I would like to know what the proper CORS headers are and how to set them up? Or is the issue that I am running on localhost?

Thanks in advance😃

@muhammadanasajjad muhammadanasajjad changed the title Setup Stockfish for use Set up CORS for stockfish-nnue-16.js Dec 21, 2023
@GuillaumeSD
Copy link

You can get the answer in the example folder :

/// Firefox needs these headers in order to handle shared array buffers for multi-threaded WASM.

You must add those two headers for requests serving your app page & the stockfish-nnue-16.js file :

resHeaders["Cross-Origin-Embedder-Policy"] = "require-corp";
resHeaders["Cross-Origin-Opener-Policy"] = "same-origin";

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

3 participants
@GuillaumeSD @muhammadanasajjad and others