Hi, I'm trying to use Netcode for GameObjects with Discord's Embedded SDK which uses a proxy and embeds a WebGL application in an iframe.
@drowsy depot Sorry for the ping but I found a few messages from you in the Discord developer server concerning this and was just wondering if you had any success with a solution to get the Unity transport to work with Discord's activities, and if you have any configurations that may help
I am also using Dissonity V2 however I don't know if that's relevant
So far, I've
- Checked Use WebSockets and Use Encryption on the Unity transport
- Am using the address of my discord client's proxy ((clientid).discordsays.com) as the WS address
- Used the port 7000 in the transport
Then, I have a MonoBehaviour to start the client and server
- If it is the server build, I read the certificate and private key for mydomain.com and call
transport.SetServerSecrets(certPem, keyPem);
- If it is the client build, I call
transport.SetClientSecrets($"{clientid}.discordsays.com");
The server runs properly, however the WebSocket connection from the client is blocked because Unity attempts to access port 0. I'm not familiar with networking so I don't know what exactly this means and if I've done something wrong
Unity.framework.js:15485 Refused to connect to 'wss://(clientid).discordsays.com:0/' because it violates the following Content Security Policy directive: "connect-src https://(clientid).discordsays.com/ wss://(clientid).discordsays.com/
In the URL mappings on the Discord portal, I only have 1 root mapping for mydomain.com. Not sure what I should change to allow Unity's websockets to work since I don't really know much about networking
Again sorry for the ping, but was just wondering if you had a working configuration already since it'd save the effort of a lot of trial and error rebuilds. Thanks 🙏