robotconscience/ofxLibwebsockets

The addon will not be compatible with ofx 0.10.0 in windows

gorkacortazar opened this issue · 5 comments

With the last release candidates of ofx 0.10.0 this addon was rendered incompatible, mostly because ofx upgraded the openSSL version to 1.1, which creates compilation conflicts the with current version of libwebsocket.

The current problems that we have identified:

  • VS2017 now doesn't compile with the current version, as the openssl version is incompatible with the version of libwebsockets, the errors are the same that they describe here: warmcat/libwebsockets#970
  • Since RC1 openframeworks in linux, openssl is not included by default in the compilation, so is required to add the flags manually in qt creator at least. This most likely can be solved with small modifications addon_config.mk. I will be testing what happens with the current RC3 today.
  • As ofx 0.10.0 includes ofJson, it will be ideal to remove the jsoncpp dependency. The inside working is slightly different, but took em one day to update our apps that were relying on ofxJson, which was also based on jsoncpp.

I'll continue to do more research and test on this and keep you posted if we manage to update some solutions, as our applications relies heavily on your addon, so we are more than glad to help.

I just noticed that in linux it compiles properly, as openframeworks does not link openssl anymore in this platform automatically, as long as you add the proper system flags to addon_config.mk

ADDON_LDFLAGS = -lssl
ADDON_LDFLAGS += -lcrypto

This is because Ubuntu include 1.0.x instead of 1.1, at least unit 18.04 that will be released tomorrow. Any suggestions on which strategy to explore will be welcomed

Hey @gorkacortazar, sorry for the delay in replying. Let me know if you've had a chance to investigate! Unfortunately I'm not able to devote much time to the addon anymore. Looking now at some OF 0.10 stuff, and it will likely break across most platforms...

Keep me posted, and I'll let you know where I get! The trickiest thing will be where libwebsockets moves to openssl 1.1, as they did a pretty extensive API overhaul that will require a lot of work. 🤞

Hey @robotconscience currently I had to stop my research, but my findings are as follows. As the migration for the openssl is complex, the situation is fragmented depending on the platforms. recent versions of libwebsockets allows to compile with support of either version of the openssl api. As per ofx

  • Ofx 0.10 on VS 2017 compiles openssl 1.1, wich makes the addon unusable. I tried to recompile it but didn't have too much time to test why the first try didn't work, I think that the API of libwesockets has changed a lot too.
  • In linux es complex too, as ofx use the openssl included in the system. In 16.04 is good for the current addon,, but in Ubuntu 18.04 we will get the same problem, uses opnessl 1.1.

Also we found a bug in the addon that we couldn't figure out how to solve it. When a client is s connected sometimes disconnects, but is impossible to reconnect it again. Seems like the context of the websocket library is not fully destroyed, and try to explicitly connect again fails, but also trying to explicitly disconnect and trying con to connect again does nothing. Only happens when you are acting as a client, not a s a server. We spent a couple of weeks and we had to move on to finish a project, but I plan to get back to both issues in a couple of weeks.

Closing this as the last merged pull request works in ubuntu16

Hi. I am Trying to build example_client_hello_world on version 0.11.0 (Windows 7, Visual Studio 2019), I get the following error.
And it looks like I'm getting the same error

image

Please tell me, for version >OF 0.9.8 is there a working solution?