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

Service worker support #76

Open
udarapremadasa opened this issue Dec 19, 2024 · 3 comments
Open

Service worker support #76

udarapremadasa opened this issue Dec 19, 2024 · 3 comments

Comments

@udarapremadasa
Copy link

udarapremadasa commented Dec 19, 2024

TCPSocket is not available in the service worker environment. is there any method to use Direct Socket in service worker environment.

@reillyeon
Copy link
Collaborator

It's not currently supported. There's no workaround. This API is currently only supported in Documents and Workers. It shouldn't be too hard to implement though.

@udarapremadasa
Copy link
Author

got it. thank you @reillyeon

@reillyeon
Copy link
Collaborator

Re-opening this issue as a tracking bug because this is something we should support eventually. A challenge I just remembered however is that we don't support Permissions Policy in Service Workers. IWAs require developers to declare permissions they are going to use (including the direct-sockets permission) in their manifest and this mechanism is built on top of Permissions Policy. We'll need to come up with a solution for that.

@reillyeon reillyeon reopened this Dec 19, 2024
@reillyeon reillyeon changed the title Can we use direct socket inside worker environment. (sw.js) Service worker support Dec 19, 2024
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