discord is blocking photonengine
FroggerHH opened this issue · 6 comments
Hi, im making discord activity game on unity. For multiplayer I'm using Photon Fusion. In browser everything works great, but inside of discord I'm getting this error.
Refused to connect to 'wss://ns.photonengine.io/?libversion=4.1.8.1&sid=30&app=8a16b0a3-846a-4362-9e7e-e1af98122584&IPv6' because it violates the following Content Security Policy directive: "connect-src 'self' https://discord.com/ https://canary.discord.com/ https://ptb.discord.com/ https://cdn.discordapp.com/ https://media.discordapp.net/ wss://1221359697018486794.discordsays.com data: blob:".
Refused to connect to 'wss://ns.photonengine.io/?libversion=4.1.8.1&sid=30&app=8a16b0a3-846a-4362-9e7e-e1af98122584&IPv6' because it violates the following Content Security Policy directive: "connect-src 'self'".
Because of this, my multiplayer doesn't work inside the discord 😢
In your URL mapping settings create a map for /photonengine
-> ns.photonengine.io
then you can use wss://{appId}.discordsays.com/photoengine... query parameters ...
.
Remember, Discord's iframe only allows Discord domains to be used, and your site is proxied through {appId}.discordsays.com
.
Oh, thanks! I'll try that way
Activities don't support UDP connections at this time. You could attempt changing Photon's protocol from UDP to TCP
Well I figured out how to fix it all