Announcement

Collapse
No announcement yet.

[Plugin] Socket.io Client

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

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

    Basically the only log we recieve from the socket is this:
    Code:
    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
    Code:
    #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:
    Code:
    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.
    Last edited by osclindstrm; 09-29-2020, 05:47 AM.

    Leave a comment:


  • replied
    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!

    Leave a comment:


  • replied
    Originally posted by DonFrag View Post
    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.

    Leave a comment:


  • replied
    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.

    Leave a comment:


  • replied
    Originally posted by HashemShepard View Post

    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/getnamo/socketio-client-ue4/issues and I'll try to help

    Leave a comment:


  • replied
    Originally posted by getnamo View Post

    https /SSL is currently not supported yet, use http. See https://github.com/getnamo/socketio-...-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 ?

    Leave a comment:


  • replied
    Originally posted by HashemShepard View Post
    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)
    https /SSL is currently not supported yet, use http. See https://github.com/getnamo/socketio-...-ue4/issues/39 for updates on the issue

    Leave a comment:


  • replied
    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)

    Leave a comment:


  • replied
    Originally posted by Ironbelly View Post

    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.

    Leave a comment:


  • replied
    Originally posted by getnamo View Post

    The current socket.io plugin doesn't support https/ssl yet, there is an open issue here: https://github.com/getnamo/socketio-...-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/UnrealE...dParty/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.

    Leave a comment:


  • replied
    Originally posted by Ironbelly View Post
    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/getnamo/socketio-...-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/UnrealE...dParty/OpenSSL) and probably change a few lines on how the underlying socket.io-cpp lib is instantiated for https addresses.

    Leave a comment:


  • replied
    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

    Leave a comment:


  • replied
    Originally posted by samuelthomson View Post
    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/getnamo/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/getnamo/socketio-...-ue4#packaging

    Leave a comment:


  • replied
    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?

    Leave a comment:


  • replied
    Originally posted by samuelthomson View Post
    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:
    - 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

    - I installed this plugin by downloading from github, but I also notice there is this: https://launcher-website-prod07.ol.e...cket-io-client
    is that something I need to package this?

    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/getnamo/socketio-...ases/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.

    Leave a comment:

Working...
X