Ryan Green
Ryan Green2mo ago

Discord Embedded App SDK

I'm trying to connect to normcore using the discord embedded app sdk, however when connecting to a room, I receive the following error:
nested.framework.js:10 Refused to connect to 'wss://normcore-matcher.normcore.io:3000/' because it violates the following Content Security Policy directive: "connect-src https://1266559993688100995.discordsays.com/.proxy/ wss://1266559993688100995.discordsays.com/.proxy/ https://discord.com/api/ https://canary.discord.com/api/ https://ptb.discord.com/api/ https://cdn.discordapp.com/attachments/ https://media.discordapp.net/attachments/ data: blob:".
nested.framework.js:10 Refused to connect to 'wss://normcore-matcher.normcore.io:3000/' because it violates the following Content Security Policy directive: "connect-src https://1266559993688100995.discordsays.com/.proxy/ wss://1266559993688100995.discordsays.com/.proxy/ https://discord.com/api/ https://canary.discord.com/api/ https://ptb.discord.com/api/ https://cdn.discordapp.com/attachments/ https://media.discordapp.net/attachments/ data: blob:".
is it possible to connect to normcore in this way?
11 Replies
kapa.ai
kapa.ai2mo ago
Hi @Ryan Green. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Hmm, I don't know enough to give you a confident answer yet. The knowledge sources provided do not contain information about integrating Normcore with the Discord Embedded App SDK. However, I can tell you that Normcore allows you to connect to a room server directly using the application's credentials. When a request to join a room comes in, the room server uses the Normcore application's credentials to create a new connection slot and return it to the cluster. The cluster then returns this to the matcher and finally the application. With the connection slot credentials, the Normcore application can securely connect directly to the room server. For testing, you can set the Custom Matcher URL to your new Normcore Private installation. The format should be wss://<DOMAIN NAME>:3000/. Please refer to the Normcore Documentation (https://normcore.io/documentation/architecture/cloud#rooms) for more details. For specific issues related to the Discord Embedded App SDK, I would recommend reaching out to Discord's support or referring to their documentation. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai2mo ago
<@337874773742845953> kapa.ai is still learning and improving, please let us know how it did by reacting below
Ryan Green
Ryan Green2mo ago
I'm realizing this is an issue on the discord side as they proxy requests, so I'll have to see if it's possible to proxy connections to normcore it looks like discord makes me proxy through their servers. So i'm able to setup a /normcore end point that proxies to normcore-matcher.normcore.io:3000 is that a possibility without having to switch to a private plan @Normal Team ?
maxweisel
maxweisel2mo ago
if you set up the proxy yourself, you can edit the URL in NormcoreAppSettings by setting a Custom Matcher URL please don’t ping the team for anything that isn’t urgent
Ryan Green
Ryan Green2mo ago
apologies
maxweisel
maxweisel2mo ago
all good, just for future reference
Ryan Green
Ryan Green2mo ago
it turns out Discord does not support WebRTC in their embedded apps. So that was the priamry issue. Wondering if there's a version of normcore that could exist as websocket only? or is webrtc essential?
maxweisel
maxweisel2mo ago
webrtc is essential
Ryan Green
Ryan Green2mo ago
word
maxweisel
maxweisel2mo ago
what is a discord embedded app btw? is that part of the Activity API? I was about to start playing with that
Ryan Green
Ryan Green2mo ago
yeah. it's in developer preview right now. was excited about getting normcore games working in it. https://discord.com/developers/docs/developer-tools/embedded-app-sdk i was using this library for discord integration... https://github.com/Furnyr/Dissonity my road block was in connecting to the server. they make you proxy all requests. I was seeing it connect via websocket, but then I would get a failure on trying to create a webrtc peer connection. further digging made me realize that discord doesn't yet support webrtc in their wrapper i found evidence of fusion users getting things working (however via multiple hops because of the proxy issue, so i'm not sure if that was viable anyway) discord seems to recommend colyseus because activity apps need to be hosted as a node server, but was hoping to use a more robust implementation like yours 🙂