Anybody using web sockets in ACF? Thoughts about t...
# cfml-general
d
Anybody using web sockets in ACF? Thoughts about that?
j
I am. They are not very well documented. I’ve used them successfully in one-to-many cases, but have been unable to figure out secure one-to-one usage.
g
Here are couple of presentations from Giancarlo Gomez on web sockets.

https://www.youtube.com/watch?v=VQIkFIIIdNQ▾

https://www.youtube.com/watch?v=ctgJv8cY20w▾

And some code examples https://github.com/GiancarloGomez/ColdFusion-Realtime-With-WebSockets
d
Thanks folks. We have some interest here, I'll put this up where the relevant folks can start getting their heads around it. Any real world experience with how it worked out in practice, both to implement and in use, is super welcome too.
g
@jc ☝️ 🙂
d
I've integrated with a React app. Had to do some adjustments to the JS from Adobe but once I got it up and running it worked great. 🙂
j
I use them in several projects, if you have any questions let me know @Dave Merrill
j
Very poorly documented. I cobbled together a little raffle app for my wife - the links @garciadev posted above were very helpful. It was basically some trial and error til something worked LOL.
d
@dcar7191 What sorts of "adjustments to the JS from Adobe" did you have to do and why?
j
@Dave Merrill if you are looking to use it from a site outside of your CF app, you can look at my HTML to ColdFusion code. https://github.com/GiancarloGomez/ColdFusion-Realtime-With-WebSockets-Demo-Code/tree/master/html-to-coldfusion
For instance, if you are using CF only for WebSockets and your React, Vue, etc .. project wants to use CF, you need to warm up the application first by hitting any cfm file as if the first request is a WS call it will fail. I have all that in the code example.
You really don’t need to do any adjustments to Adobe’s JS files, in my example I don’t even use them, you just need to know how to initiate the connection as they require a specific payload.
Everything is initiated using
new WebSocket()
and then you have access to the full api
If you are accessing from a cfm file then just use the cfwebsocket tag and then you write JS for what you plan to do :-)
d
@Dave Merrill That is a great question. For actual specifics I would need to go back and look but to @jc comment you don't need to use them. It might have been me being ignorant and on several learning curves all at the same time. In the end, I had some pretty sophisticated things working including white boards, games and so on.
j
Feel free to DM @Dave Merrill if you have any further questions
d
I would also affirm @jc is much more of an expert than I am! lol
j
Thank you @dcar7191!
g
No, thank YOU Señor Web Sockets @jc! 🤠
👍 1
😂 1