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

Scalability and Content Security Policies inside Discord Activities (Discord Embedded SDK) #707

Open
endel opened this issue Mar 20, 2024 · 1 comment
Milestone

Comments

@endel
Copy link
Member

endel commented Mar 20, 2024

Context & Description

When scaling the number of processes by setting the publicAddress config in the server, the client will not be able to connect to the server from within the sandboxed Discord Activity due to CSP:

image

This problem occurs because the Colyseus SDK will use the publicAddress configured in the server to establish the WebSocket connection, whereas the Discord Activities require every request to go through their sandboxed relative URLs where URL Mappings can be set for external services.

Proposed API

The client-side SDK should be able to customize the endpoint URL before trying to establish the connection. We could expose an API that is capable of customizing the output of buildEndpoint()

@endel
Copy link
Member Author

endel commented Mar 21, 2024

Matt recommended checking patchUrlMappings to help with this 🙌 https://discord.com/developers/docs/activities/development-guides#using-external-resources

image

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

1 participant