SocketIOClient-Unreal icon indicating copy to clipboard operation
SocketIOClient-Unreal copied to clipboard

Unable to connect from Oculus Quest 2 build

Open nateainsworth opened this issue 2 years ago • 4 comments

I can connect from Oculus to the server fine while running the application locally off unreal on the PC. However, when I build the project, I can't connect. I'm using SSL on the server and HTTPS within the URL. I force HTTPS connections only, so the website doesn't allow HTTP, I've updated the Android manifest to enable Internet from advice on forums with the following lines <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Looking through forums online, there's a common trend of people struggling with this, I believe one reason to be androids' restrictions on unsecured connections, which is why I'm using SSL. Although I have come across a few which have managed to get the connection working, there's no insight into how they managed it.

If anyone has any ideas on how I could experiment to attempt to get this working, I would appreciate it.

nateainsworth avatar Aug 31 '22 09:08 nateainsworth

Okay, so if it helps, I've managed to get WebSockets to connect without any need for SSL or anything, so it's something with socket.io / the plugin stopping me from connecting to the server on an oculus build. I've used the following WebSocket code to get it working in case anyone else comes across the same issue https://github.com/chris-gong/websocket-client-example-ue5/blob/main/Source/WebSocketTest/WebSocketTestGameInstance.cpp However ideally I would like to get socket.io working as I prefer the plugin and library on my server-side talking to the website.

nateainsworth avatar Sep 01 '22 08:09 nateainsworth

Don't have a quest 2 to test this myself, do you know if builds to normal android targets such as an Android phone has the same issue?

This seems to hint at a config or SSL dependency copy problem (maybe pragma macros for ssl enabling fails on Oculus platform?)

getnamo avatar Sep 01 '22 09:09 getnamo

I don't have any other android devices it's a weird one as a setup on WebSockets doesn't require any SSL and it connects to wss://example.com just fine once built, but then I believe socket.io connects over HTTP instead and so maybe it does require SSL or something (I did test out connecting using ws, wss, HTTP and https). However, I did set this up, and with or without SSL couldn't get the plugin to work on the Oculus.

nateainsworth avatar Sep 07 '22 11:09 nateainsworth

My best guess is that the oculus 2 platform is not considered android in pragma/build.cs and is getting code excluded, check the platform strings required, those would need to be added for code checks in pragmas and build.cs filters.

getnamo avatar Sep 07 '22 15:09 getnamo

Check if https://github.com/getnamo/SocketIOClient-Unreal/issues/348 fixed this issue

getnamo avatar Nov 14 '22 19:11 getnamo