[Plugin] Socket.io Client

Open an issue on https://github.com//socketio-client-ue4/issues with detailed description on how to reproduce your bug and I’ll take a look

I think i didi it

Almost :). You opened a pull request alright, but that’s just to merge my issue-150 branch into master. What you need to do is to fork master, edit the change and open a pull request to merge your edited fork into e.g. master

Plugin updated to v1.1.0
There were a lot of changes for this release

Some key features:

Emit with Graph callback. Now you can ‘get’ information from the server without breaking your graph flow

https://camo.githubusercontent.com/b48190cf7a67687e24ee8770e96c2d0a410b2cda/68747470733a2f2f692e696d6775722e636f6d2f4362464878526a2e706e67

Static Component Construction. Want to add socket.io connections to your game instances or game modes without using C++? This is now supported with same API you’re used to

https://camo.githubusercontent.com/180ff46e42897bbd96aca79b34938bb4afa5109a/68747470733a2f2f692e696d6775722e636f6d2f455834616e78642e706e67

Convert wav and opus bytes to Soundwaves so you can play them. Should make it easier to test VOIP systems based on socket.io. You can also now issue event callbacks to arrive on your network thread if latency is a high priority (keep in mind that you’ll need only do threadsafe actions on background threads i.e. no UObject allocation).

https://user-images.githubusercontent.com/542365/64088506-a42dd900-ccf6-11e9-8dd1-d2305ca0c77e.PNG

There are also utility bps that allow you to do basic multi-threading in blueprint. e.g. enter a background thread, do some heavy computation task and callback on game thread with result.

https://user-images.githubusercontent.com/542365/64096459-97b97880-cd16-11e9-9dd5-cd3a3cf7ddd8.png

In SIOJson, you can now interweave Enum types in structs and they will be correctly translated into their string equivalent.

(see https://github.com//socketio-client-ue4/releases/tag/1.1.0 for full details).

Marketplace update has been submitted and pending.

If you’ve been having disconnection problems, try out the new release and let me know if any new issues crop up!

Hello, I’ve built a project with SocketIO in unreal v4.21.2. I used the version of SocketIO for v4.21 and v4.22. Everything works fine when I run from the editor, but trying to package the project fails with “unknown build error”.

I’ve attached the output log from Unreal, and the log file from appdata - can you tell me what is going wrong?

I’m not very used to packaging projects with plugins, so perhaps I’ve not set things up correctly.

This is a fairly urgent question for my project, as it has to go live in a couple of days, so thanks in advance for any response.

Edit:

Edit 2: I think I’ve answered my own question, it seems like I was using SocketIO for Unreal 4.22 instead of the version for Unreal 4.21!

You may want to look at https://github.com//socketio-client-ue4/releases/tag/1.1.0 release which has 3 versions (4.21-4.23). The marketplace version is just a way for people to help support plugin work, totally optional.

Hello again,

I’m having another issue - SocketIO now works fine in the editor, and I can get the project to build, but when I play the build, the behavior relating to SocketIO doesn’t seem to be occurring at all. This is doubly strange, as in the last couple of days I successfully packaged a very similar project and everything worked fine.

I created this project starting with a blank game project, and then I migrated assets from my old project over to this new project.

Once again,

  • I’ve made sure my project is a Blueprints and C++ project, https://allarsblog.com/2015/11/05/co…roject-to-cpp/
  • I’ve also added “SocketIOClient” to ProjectBuild.cs under PublicDependencyModuleNames
  • Made sure I’m using the right version of SocketIO this time!

Is there anything else I should check?

maybe firewall? otherwise open an issue on https://github.com//socketio-client-ue4/issues with detailed steps to reproduce (and platform/version used etc). Even better if you can link a minimal project that reproduces issue.

Some platforms may need a few extra toggles to work: https://github.com//socketio-client-ue4#packaging

We’re running into some issues here as well that I was wondering if anyone could shed some light on. The websocket connection is dying in UE right after application data, we get through hellos, cert, and key exchange, then we send data and it sends an encrypted alert that appears to be a close message (warning severity doesn’t have a 0, 1, or 255 - but I suppose this could also be corrupted data?)

Node can connect to the service just fine. First, I noticed they were using different TLS versions so I changed the UE stuff to use 1.2 like node does.

Now I’m looking at traffic and I see they are using different ciphers - node uses TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (0xc02f) and works, but UE is using TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 (0xcca9) even though it lists the first one in its client hello as well as the second. It’s not giving me a legit mismatch message or anything (unless the data in the alert message is corrupted and I just can’t read it) after the encrypted alert, it’s one more app data followed by ACK, FIN/ACK, and RST

The current socket.io plugin doesn’t support https/ssl yet, there is an open issue here: https://github.com//socketio-client-ue4/issues/39 which is on the docket but not yet fixed. Largely all that is missing is to include openssl as a third party lib (which the engine has https://github.com/EpicGames/UnrealEngine/tree/release/Engine/Source/ThirdParty/OpenSSL) and probably change a few lines on how the underlying socket.io-cpp lib is instantiated for https addresses.

heh, yea we fixed all of this up on our end within the first couple of days but now we’re on to bigger and better problems causing us to rip our hair out.

If you have a fix working, consider making a pull request. Can’t help if the problem can’t be replicated on my end.

can someone help me , i’m getting this error (socketio invalid appears lost connection) what does it mean ?
i’m trying to connect to (https://(certain site running on groom test server).run.goorm.io:19834)

http**s **/SSL is currently not supported yet, use http. See https://github.com//socketio-client-ue4/issues/39 for updates on the issue

thanks for your reply , i switched to the http version and still got the exact same error , anything else to try ?

Open an issue with detailed steps to reproduce the error on https://github.com//socketio-client-ue4/issues and I’ll try to help

Just fyi, i wanted to implement websockets instead of socket.io and i realized that you are using a external websocket library, buy i found that ue4 has its own websocket library, in case you need to replace for a internal solution.

I appreciate the ping, that said the internal library (libWebSockets) has a few features missing compared to the external lib (websocketpp: largely c++11 vs c api and more control over underlying functionality) and with the boost-less build process used since v1.0, using the external library is painless. It would take a very specific advantage for the third party dependency to be swapped.

I have been trying to upgrade my project to 4.25 version, but this Plugin gives me an error when packaging the game. No errors when compiling. Any updates to the plugin? Thanks!

We are getting issues while trying to connect to our Socket.IO api.

Basically the only log we recieve from the socket is this:


SocketIOLog: SocketIO Invalid appears to have lost connection, reconnecting attempt 0 with delay 5000

.

This is despite the not getting a connection started in the first place.

I have changed the sio_client_impl.h & cpp files to use TLS by adding this line


#define SIO_TLS 1

as well as adding “OpenSSL” to the private and public dependency modules of SocketIOLib.Buid file. Had to fix some compilation errors but everything builds fine now.

This is what my connection code looks like:




TSharedPtr<FJsonObject> QueryParams = MakeShareable(new FJsonObject);
QueryParams->SetStringField("token", TokenForPlay);

Socket->VerboseLog = true;
Socket->Connect(FString(Base_URL + "/play"), QueryParams, nullptr);

Socket->OnConnectedCallback = [this](const FString& InSessionId)
{
Log(2, "Connected", Info);
};



Our socket lives under the resouce /play (https://api.xxxxx.com/play). I’ve tried every different configuration(joining the /play namespace, only using the base url etc. ) that I’ve been able to come up with and nothing has worked so far. I don’t know if I’m being fooled by the log message and TLS is actually not being used. I’ve tried to look through the implementation, and I’m at my wits end.

Any help is greatly appreciated.