Multiplayer game using Socket.io/NodeJS connects successfully within the Unity Editor/Simulator but not on my iPhone?

I’m building a simple multiplayer game in Unity using Node JS and Sockets IO. The server is hosted on AWS.

To connect to the server in the game I am using the following library: GitHub - itisnajim/SocketIOUnity: A Wrapper for socket.io-client-csharp to work with Unity.

When testing this in the Unity simulator a connection is made successfully and all data is received and emitted correctly. However when I make a build for iOS no data is received or emitted. I’ve setup some trivial debugging for this but I haven’t found much documentation on it for the actual socket connections. It’s also not clear reading the backtrace on Xcode what the issue is.

After reading through many posts here I thought that the issue was related to SSL or some other security problem so I setup a domain name and SSL on port 3000 (with HTTPS) thinking this may fix it. But this did not fix it.

After more digging I thought it could be related to the actual configuration on Xcode so I enabled the domain name/IP through an App Transport Security Exception (via signing and capabilitites) as well as enabling all Network Extensions. But still no luck.

What is strange is that if it runs fine in the Unity Editor then I know the code itself works, meaning there must be a security related issue somewhere?

If anyone has any idea any help would be much appreciated!

What I’ve tried to solve this so far:

  • updating the Unity Editor to the latest version
  • setting up a server on AWS with HTTPS on port 3000
  • enabling all network extensions in Xcode
  • adding an App Transport Security Exception in Xcode
  • reading other posts on stack overflow
  • reading documentation on the existing package
  • adding debugging to the scripts

What I’m expecting is the same behaviour I get in the Unity Simulator to appear on my iPhone. I.e. it makes a successful connection with my NodeJS server and receives/emits data correctly.

Hello,

Would you kindly please report this issue via the Bug Reporter tool?
https://unity.com/releases/editor/qa/bug-reporting
Please make sure to write the exact steps needed to be taken so that the reproduction would be visually seen. Also make sure to attach a reproduction project and any visual material so that when testing our CQA team can verify that they got the same results. If you can, please use this template:

How to reproduce:

  1. Open the attached project
  2. Do this
  3. Do that
  4. Select this
  5. Observe that

Expected result: Something is visible, something is printed or something happens
Actual result: The opposite of what I expect happens

Reproducible with: Editor version I am using (e.g: 2021.3.xf1)

Reproduced on: The OS I am on (e.g: Windows 11, macOS Ventura 13.1 (Intel/Silicon))