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 --coop option to enable cross-origin isolated #806

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vapier
Copy link

@vapier vapier commented Apr 17, 2022

In order to utilize some web features like SharedArrayBuffer via
localhost, COOP & COEP headers have to be set. Add an --coop
option to let people easily opt-in to them. These are important
for things like WebAssembly testing.

More information can be found at:
https://web.dev/cross-origin-isolation-guide/

Contributor checklist
  • Provide tests for the changes (unless documentation-only)
  • Documented any new features, CLI switches, etc. (if applicable)
    • Server --help output
    • README.md
    • doc/http-server.1 (use the same format as other entries)
  • The pull request is being made against the master branch
Maintainer checklist
  • Assign a version triage tag
  • Approve tests if applicable

In order to utilize some web features like SharedArrayBuffer via
localhost, COOP & COEP headers have to be set.  Add an --coop
option to let people easily opt-in to them.  These are important
for things like WebAssembly testing.

More information can be found at:
https://web.dev/cross-origin-isolation-guide/
@vapier
Copy link
Author

vapier commented Aug 11, 2022

Fixes #650

@PoignardAzur
Copy link

For what it's worth, I would really like this option as well. Not being able to enable cross-origin isolation, and therefore wasm threads, was a dealbreaker for me, and made me replace htttp-server with a bespoke solution. I'd really like if something like this was merged.

@JakobGue
Copy link

Please merge! This would be so helpful.

@liudonghua123
Copy link

It's the same as #759. Please merge! I want to use SharedArrayBuffer, and they are required headers.

See also https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer#security_requirements.

alxndrsn pushed a commit to alxndrsn/pouchdb that referenced this pull request Apr 2, 2024
See: https://developer.mozilla.org/en-US/docs/Web/API/Performance/now#security_requirements

This requires a change of dependencies from http-server to serve as http-server does not currently support setting the required headers.  See:

* http-party/http-server#759
* http-party/http-server#806
Scarabol added a commit to Scarabol/ffmpeg.wasm that referenced this pull request Feb 23, 2025
Wait for http-party/http-server#806 to be merged
or http-server with --header argument support, since 14.1.1 was released
almost 3 years ago.
Scarabol added a commit to Scarabol/ffmpeg.wasm that referenced this pull request Feb 23, 2025
Wait for http-party/http-server#806 to be merged
or http-server with --header argument support, since 14.1.1 was released
almost 3 years ago.
Scarabol added a commit to Scarabol/ffmpeg.wasm that referenced this pull request Feb 24, 2025
Workaround for http-party/http-server#806 to be merged
or http-server with --header argument support release, since 14.1.1 was released
almost 3 years ago and header support added after
Scarabol added a commit to Scarabol/ffmpeg.wasm that referenced this pull request Feb 24, 2025
Workaround for http-party/http-server#806 to be merged
or http-server with --header argument support release, since 14.1.1 was released
almost 3 years ago and header support added after
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

Successfully merging this pull request may close these issues.

4 participants