-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connect via URL instead of IP #72
Comments
This already works, e.g. https://github.com/getnamo/tensorflow-ue4-examples/blob/master/Content/ExampleAssets/Blueprints/ConnectedTFMnistActor.uasset uses Just make sure you specify both url and port http://{your url}:{socketio port}. Default http port btw is 80. |
Thanks for the quick response, however that doesn't work for us. The logger of the underlying socketIO impl do not output to the UE4 logs, but with manual debugging I found the error code being "pass_through - Underlying Transport Error". No clue what that means. Tried it with port, without, with leading http:// and https:// and without. And those IP's that do work resolve to the exact same IP's. JS SocketIO has no issue connecting to the same URL's. |
NB: https isn't currently supported see #39. Make sure you're not using SSL |
I just tested with it, we don't require https. Edit: And we don't use SSL. |
Have you tried a url at the root domain? e.g. like We'd could use a working minimal example of a server with path and javascript client with path to see what's missing in the c++ client. |
Sorry that I didn't respond, had some other issues to work on. And I was being stupid, sorry for that, we indeed use HTTPS. Now I am 99% sure I tested on non-https too, but maybe I had a typo or something, I don't know, at least non https URL's now work, but yeah.. Really need HTTPS to work. So I'll look into how to enable it. |
So I spend the whole day trying to get OpenSSL working, and it is a total pain in the ***. To get everything running for a x64 machine. Eventually I tried 5 different versions of socket io cpp, got OpenSSL integrated and UE4 starting up 2 times, but only to find out that now no IP or URL at all works anymore.. |
My current run is using your prebuild repository, where I had to tweak a ton already to make CMake build with OpenSSL and find the proper boost libs, but yeah... When I bind the sioclient_tls.lib, it just doesn't work.. Spits out ITERATOR_DEBUG_LEVEL mismatches when I try to use the debug build, so I can't debug it either.. |
It's awesome to have another pair of eyes on getting this set up. Getting everything to splice even for the regular non-ssl version was always a day affair for me and I'm frankly a noob at cmake. If you get a working build, consider making a pull request on prebuild and here. Regarding TLS, Have you had a look at these two issues socketio/socket.io-client-cpp#13 First issue should point at code changes that were needed for TLS work with socket.io and issue 46 points to needing a macro define for things to compile. Other than that you can still run UE4 in debug mode while having release libraries linked which may hint at where the issue may lie even if the lib code is not all exposed. |
Got it working. It required a ton of cheat-arounds though and god do I hate CMake. Same goes for me, I know the basics of it but I want to vomit each time I have to use it :P Had to change the CMakeList.txt, add a bunch of dll's, windows lib's, and even change some websocketpp code that just didnt wanted to compile (just an undefined enum, so I hardcoded the integer value in). Another PITA was x64 vs x86, as I couldnt get anything with x86 to run I had to figure out how to make CMake build x64 solutions. I'll see if I can figure out a way to do a pull request, however I noticed that connections to normal HTTP servers don't work anymore with TLS enabled. I can share the code privatly with you first if you also want to have a look on how to use TLS only when applicable. |
I'd be definitely interested in the build configs changed for ssl and working prebuilt libraries (.lib). Even if it is a trade off atm it would get us closer to getting a full solution. What I've done is open a new branch called |
Alright, I will see if I can get anything useful together. Issue here is I have around 5-6 sioclient projects on my PC now and I think I even had to use a special version of the websocketpp repo. If I create a pull request I at least want it to be somewhat useable and approved, so it might take me a bit. Also, you created the branch on the plugin, not the prebuild. :) |
Whoops :)! here's the new branch https://github.com/getnamo/socketio-client-prebuild/tree/windows-ssl Note that the pre-build uses submodules: https://github.com/getnamo/socketio-client-prebuild/tree/windows-ssl/src which then depends on submodules: https://github.com/getnamo/socket.io-client-cpp/tree/bfa0a53a4851cbbd56d4606c6d6fbed3f81a964b/lib so you can also add pull requests there to update the websocket library and it will all be contained :) (made a branch there too: https://github.com/getnamo/socket.io-client-cpp/tree/ssl-fixes) |
As I currently have a ton to do, for now I zipped up the socket io cpp folder with the cmake files and everything. https://www.dropbox.com/s/rukc165a0uj91m1/socket.io-client-cpp.zip?dl=0 I also had to make TLS to use the OpenSSL of UE4 (because otherwise there were multiple definitions of the crypto lib while packaging), so you will need to replace the reference to it in the sioclient_tls project. I think I only have the working settings in the configuration RelWithDebInfo x64. And here the (messy) build.cs btw the lib's I link in the build.cs are part Windows, |
Hey, any updates on this? |
The issue lies at the underlying websocketpp library, which requires an update to support TLS and non TLS endpoints at the same time. Some movement has been made toward providing easy examples to support this here zaphoyd/websocketpp#734 and here zaphoyd/websocketpp#706 Once an example is available for reference in order to update https://github.com/socketio/socket.io-client-cpp we can merge that in when we recompile the library for this plugin's use. Contributions are welcome! |
Okay, I followed links, and found this commit socketio/socket.io-client-cpp#137. I managed to integrate it in socket.io and build the lib. How can I recompile your plugin in order to test if everything is working correctly? --- This basically adds a new constructor that accepts url as parameter, then call connect() with no parameters to connect, and based on url it will determine whether to use https or http. EDIT: Figured it out, should add those files directly to ue4 plugins/socketio-client-u4/Source. Trying to build now, will report later what happened. UPDATE: Getting bunch of LINK errors, unresolved externals and mismatches after adding modified plugin lib and headers. UPDATE2: Here's the error log https://gist.github.com/rastko1996/5ef59b8aaf6ee80cf27946534cdf8182 |
Will take a peek at that when I have the time, maybe on saturday. It's been a while since I got it working and didn't touch it since. |
Why hasn't this been added to the main repo before this guys dropbox takes that script down?? |
Hey.
Currently having no success establishing a connection when using an URL as the parameter for the Connect function instead of an IP Adress. We'll be using a load balancer and therefore the IP of our servers will change. Is there any integrated way of connecting to an URL instead?
All the best,
Mykon
The text was updated successfully, but these errors were encountered: