Websockets in Lucee

1,624 views
Skip to first unread message

John Blayter

unread,
Jun 2, 2015, 12:57:24 PM6/2/15
to lu...@googlegroups.com
Has anyone been able to get websockets to work in Lucee? I have an upcoming project here that I need to start on later this week that would be perfect use case for them but I don't see them supported yet.

Thanks,

John

AJ Mercer

unread,
Jun 2, 2015, 8:16:15 PM6/2/15
to lu...@googlegroups.com
I have been meaning to check this out


--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/b303cefd-11dc-450e-bd6f-824087f4a848%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Mark Drew

unread,
Jun 3, 2015, 3:10:48 AM6/3/15
to lu...@googlegroups.com
There is also this 


Mark Drew
- Sent by typing with my thumbs. 

Robert Munn

unread,
Jun 3, 2015, 3:19:05 AM6/3/15
to lu...@googlegroups.com
If you need a web socket client, I wrote one in Java:


I just added some basic implementation instructions that explain how to instantiate it and send messages.

Robert


Nicholas Kwiatkowski

unread,
Jun 11, 2015, 5:01:56 PM6/11/15
to lu...@googlegroups.com
I'm the one who wrote the one that AJ mentioned below.  I have four projects in production using it under Lucee 4.5.  One of them has appx 2,000 connected clients on a single instance at any given moment.  The only bump I've ever run into is when you deploy it to Amazon, you need to watch for their load balancer, since it doesn't support WebSockets.

I haven't tried it on Lucee 5.x yet.  I'm sure there will need to be some work done to it to make it OSGi compatible.  

-Nick

John Blayter

unread,
Jun 11, 2015, 5:59:52 PM6/11/15
to lu...@googlegroups.com
This is the library that I tried to get working with just a express version of Lucee and as soon as I added in the listener entry to the web.xml it wouldn't start. I will give it another shot later on tonight. 

John Blayter
m: 303.325.1979

--
You received this message because you are subscribed to a topic in the Google Groups "Lucee" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lucee/_9SmGV4e1qA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lucee+un...@googlegroups.com.

To post to this group, send email to lu...@googlegroups.com.

Michael van Leest

unread,
Jun 15, 2015, 12:01:56 PM6/15/15
to lu...@googlegroups.com
If you want to use web sockets with AWS ELB, make sure to use TCP instead of http/https.
By using TCP, you can use web sockets, but if you use SSL, you need to process that on the server level, not the ELB.

Hope that helps.


For more options, visit https://groups.google.com/d/optout.



--
Michael van Leest

Nicholas Kwiatkowski

unread,
Jun 21, 2015, 9:26:40 AM6/21/15
to lu...@googlegroups.com
By the way, this only works if you open a websocket on a different port, instead of using the existing servlet (like my engine does).  The AWS EBL does not understand the UPGRADE HTTP directive and ends up blocking it.  

-Nick

Tom Miller

unread,
Jul 3, 2015, 9:28:53 PM7/3/15
to lu...@googlegroups.com
Nicholas - I'm giving your project a spin, however - in your git readme it says "Copy the wsRailoEndpoint.jar" - well, that's not in the repo.

I compiled it, but others may not know how to. Just thought you should know.

Thanks,


Tom.

Nicholas Kwiatkowski

unread,
Jul 7, 2015, 9:11:54 AM7/7/15
to lu...@googlegroups.com
It's actually located on the Releases tab on the GitHub repo.  I need to update the docs a bit since GitHub lays things out a bit different than Google Code.

-Nick

Steven Neiland

unread,
Aug 19, 2015, 8:56:37 AM8/19/15
to Lucee
I am trying to get this working on Lucee 4.5 but when I create my websocket driver event gateway it returns a status of "failed". Everything looks to be in the correct place.

Jordan Michaels

unread,
Aug 19, 2015, 2:22:59 PM8/19/15
to lu...@googlegroups.com
Need more info. What is returning the failed status? Lucee? The web socket client?

What have you checked so far? Lucee config? Lucee log files?

Help us help you! ;)
https://www.youtube.com/watch?v=XmlXU4uK5rA

Kind regards,
Jordan Michaels
--
See Lucee at CFCamp Oct 22 & 23 2015 @ Munich Airport, Germany - Get your ticket NOW - http://www.cfcamp.org/
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/9d80944d-bebb-4d5e-93e1-78c155275b05%40googlegroups.com.

Steven Neiland

unread,
Aug 24, 2015, 7:12:10 AM8/24/15
to Lucee
Actually never mind. After further investigation I realized that my client was failing to connect because the version of apache I have on local is 2.2 which does not proxy ws:// out of the box (It needs a 2.4 module recompiled for it to work). I just changed my client to go directly to railos port number and everything worked.

lu...@lesener.de

unread,
Sep 9, 2015, 5:18:28 AM9/9/15
to Lucee
Nicholas - 

I'm trying to get your WS implementation running under Lucee 4.5. 
I can set up a new Event Gateway in the admin, and it also says "running", but I can't hit ws://{server}/wsEndpoint/{channel} (tried the HTML5 client at websocket.org). The log file referenced in WebsocketWatcherListener.cfc is not created, so my guess is the CFC is not invoked at all. 
Any pointers where to investigate further?

rgds
Lutz

Carl Steinhilber

unread,
Apr 23, 2016, 5:36:45 AM4/23/16
to Lucee
Nicholas,

It looks like I finally have everything set up properly under Lucee, and the "railoWebSocketServer" is running (per Event Gateway admin).
But I'm getting a 404 when I try to connect to it in my HTML5 app.

The WebSocketListner.log shows that the channel is being initialized:

"Initilizing WebSocket interceptor for channel [testing]"

Should there be another log item for when/if initialization is successful, or is that the only line I should be getting?

gateway.log shows
"INFO","Thread-13309","04/22/2016","15:11:38","Gateway:wstest","start"
"ERROR","Thread-13318","04/22/2016","15:12:13","Gateway:wstest","javax/websocket/Session"

exception.log gives a full trace, but it looks like it's bombing on
<cfset variables.wsJavaDriver.watchChannel(config.channel)>

in /lucee/components/lucee/extension/gateway/WebsocketWatcher.cfc


Any ideas?
Thanks!
-Carl

Rory Laitila

unread,
Apr 25, 2016, 8:51:33 AM4/25/16
to Lucee
What is the full stack trace where its failing? 

Carl Steinhilber

unread,
Apr 27, 2016, 3:47:37 PM4/27/16
to Lucee
On Monday, April 25, 2016 at 5:51:33 AM UTC-7, Rory Laitila wrote:
What is the full stack trace where its failing? 



"ERROR","Thread-13318","04/22/2016","15:12:13","",";javax/websocket/Session;javax/websocket/Session
at java.net.URLClassLoader$1.run(URLClassLoader.java:366):366
at java.net.URLClassLoader$1.run(URLClassLoader.java:355):355
at java.security.AccessController.doPrivileged(Native Method):-2
at java.net.URLClassLoader.findClass(URLClassLoader.java:354):354
at java.lang.ClassLoader.loadClass(ClassLoader.java:425):425
at java.lang.ClassLoader.loadClass(ClassLoader.java:358):358
at java.lang.Class.getDeclaredMethods0(Native Method):-2
at java.lang.Class.privateGetDeclaredMethods(Class.java:2625):2625
at java.lang.Class.privateGetPublicMethods(Class.java:2743):2743
at java.lang.Class.getMethods(Class.java:1480):1480
at lucee.runtime.reflection.storage.SoftMethodStorage.store(SoftMethodStorage.java:66):66
at lucee.runtime.reflection.storage.SoftMethodStorage.getMethods(SoftMethodStorage.java:49):49
at lucee.runtime.reflection.Reflector.getMethodInstanceEL(Reflector.java:491):491
at lucee.runtime.reflection.Reflector.getMethodInstance(Reflector.java:680):680
at lucee.runtime.java.JavaObject.call(JavaObject.java:234):234
at lucee.runtime.java.JavaObject.call(JavaObject.java:259):259
at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:743):743
at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1593):1593
at lucee.extension.gateway.websocketwatcher_cfc$cf.udfCall(xxxxxxxxxxxxxx/WEB-INF/lucee/components/lucee/extension/gateway/WebsocketWatcher.cfc:42):42
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:111):111
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:328):328
at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:216):216
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:608):608
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:524):524
at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1778):1778
at lucee.runtime.ComponentPage.callWDDX(ComponentPage.java:670):670
at lucee.runtime.ComponentPage.call(ComponentPage.java:202):202
at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:954):954
at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:906):906
at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:225):225
at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:37):37
at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2265):2265
at lucee.runtime.gateway.GatewayEngineImpl.call(GatewayEngineImpl.java:358):358
at lucee.runtime.gateway.GatewayEngineImpl.callOneWay(GatewayEngineImpl.java:329):329
at lucee.runtime.gateway.CFCGateway.callOneWay(CFCGateway.java:169):169
at lucee.runtime.gateway.CFCGateway.doStart(CFCGateway.java:99):99
at lucee.runtime.gateway.GatewayThread.run(GatewayThread.java:41):41
" 

Line 42 in the installed version of WebsocketWatcher.cfc is the line I mentioned above
<cfset variables.wsJavaDriver.watchChannel(config.channel)>

julien....@gmail.com

unread,
May 10, 2016, 12:18:16 PM5/10/16
to Lucee
I try to install the version of Nicholas. I got a failed status on the Admin: Services - Event Gateway page.

The only thing I'm not sure is that I have not seen any web.xml like in the railo server. I have created one at the same place and put the listener code.

Thank you,
Julien

julien....@gmail.com

unread,
May 10, 2016, 3:28:52 PM5/10/16
to Lucee
It's working now... added this 2 lines on my httpd config

ProxyPass / ws://127.0.0.1:8888/
ProxyPassReverse / ws://127.0.0.1:8888/

And for the failed status, I changed few paths on WebsocketWatcher.cfc

Heinz Baltes

unread,
Aug 10, 2016, 4:39:59 PM8/10/16
to Lucee
Hi Jordan,
I had a comparable problem. I have configured the Lucee V4.5.2.018 server to work with WebSockets. I have configured  6 Event Gateways on different ports. The WebSockets work fine!? ...but in the Lucee server admin all Gateways are marked as State "failed".
The only information I got is after the server/Tomcat V8 startup in the Lucee/logs/websocket.log
Here it states

"INFO","localhost-startStop-1","08/10/2016","14:10:49","","WebSocket Gateway [restwert_viewuser] initialized"
"INFO","localhost-startStop-1","08/10/2016","14:10:49","","WebSocket Gateway [insurerw_cardata] initialized"
"INFO","Thread-11","08/10/2016","14:10:49","","Starting websocket server on port 10128"
"INFO","localhost-startStop-1","08/10/2016","14:10:49","","WebSocket Gateway [restinza_cardata] initialized"
"INFO","Thread-12","08/10/2016","14:10:49","","Starting websocket server on port 10127"
"INFO","localhost-startStop-1","08/10/2016","14:10:49","","WebSocket Gateway [restwert_cardata] initialized"
"INFO","Thread-13","08/10/2016","14:10:49","","Starting websocket server on port 10126"
"INFO","localhost-startStop-1","08/10/2016","14:10:49","","WebSocket Gateway [insurerw_viewuser] initialized"
"INFO","Thread-14","08/10/2016","14:10:49","","Starting websocket server on port 10125"
"INFO","Thread-15","08/10/2016","14:10:49","","Starting websocket server on port 10130"
"INFO","localhost-startStop-1","08/10/2016","14:10:49","","WebSocket Gateway [restinza_viewuser] initialized"
"INFO","Thread-16","08/10/2016","14:10:49","","Starting websocket server on port 10129"
"INFO","Thread-11","08/10/2016","14:10:49","","Started websocket server on port 10128"
"INFO","Thread-16","08/10/2016","14:10:49","","Started websocket server on port 10129"
"INFO","Thread-14","08/10/2016","14:10:49","","Started websocket server on port 10125"
"INFO","Thread-13","08/10/2016","14:10:49","","Started websocket server on port 10126"
"INFO","Thread-12","08/10/2016","14:10:49","","Started websocket server on port 10127"
"INFO","Thread-15","08/10/2016","14:10:49","","Started websocket server on port 10130"

...which lookes successful! ...and it works!?

Why is the state at the server marked as "failed"?

Best regards
Heinz

Nicholas Kwiatkowski

unread,
Aug 21, 2016, 10:58:16 AM8/21/16
to Lucee
If you want to submit a pull request of those changes to make it compatible with Lucee, that would be great.  I can get a clean build out for everybody.

-Nick

JP

unread,
Sep 18, 2016, 5:24:56 PM9/18/16
to Lucee
What's the most recent update on this issue? Are there any recent developments on this issue? I need to implement websockets on Lucee, ideally in a distributed environment, but I'll take a single-server implementation to start with. I ran into this repo, but I couldn't figure out how to implement a receive message callback:

Mark Drew

unread,
Sep 19, 2016, 4:15:40 AM9/19/16
to lu...@googlegroups.com

Maybe raise a ticket in that GitHub repository? 

Mark Drew
- Sent by typing with my thumbs. 
--
Get 10% off of the regular price for this years CFCamp in Munich, Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€ instead of 210€. Visit https://ti.to/cfcamp/cfcamp-2016/discount/Lucee@cfcamp

---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

Igal @ Lucee.org

unread,
Sep 19, 2016, 11:40:14 AM9/19/16
to lu...@googlegroups.com

I wonder, how do people use WebSockets with Lucee?

I can think of these scenarios:

  1) Applications where the users communicate without Lucee, e.g. Chat -type.

  2) Applications where the users subscribe for information and then Lucee would send them updates, probably via an Event Gateway, e.g. Stock Ticker -type.

In what other ways do you guys use WebSockets with Lucee/CFML?

Igal Sapir
Lucee Core Developer
Lucee.org

lu...@lesener.de

unread,
Sep 19, 2016, 12:07:56 PM9/19/16
to Lucee
We use scenario #2 quite a lot in several Sports applications where users subscribe to updates or fresh data gets pumped out to big displays, overlays for video production and so on.
Most of the time we're using Nicholas' implementation mentioned earlier in this thread, but last time I checked it didn't run under Lucee 5 -- we'd love to see a WebSocket implementation for Lucee 5 :)

Rgds
Lutz

JP

unread,
Sep 19, 2016, 12:59:27 PM9/19/16
to Lucee
All modern web apps these days are likely to use websockets. Look at github, or any apps that are built on github. Any app that allows users to interact with it is a candidate for websockets.

JP

unread,
Sep 22, 2016, 2:10:15 PM9/22/16
to Lucee
FYI, I created an enhancement request in the Lucee issue tracker for this:


Please vote for it!

Robert Munn

unread,
Sep 22, 2016, 3:56:32 PM9/22/16
to lu...@googlegroups.com
I use web sockets from Lucee to send updates from LogBox to a NodeJS relay using a WebSocketAppender.

On Mon, Sep 19, 2016 at 11:40 AM, Igal @ Lucee.org <ig...@lucee.org> wrote:

I wonder, how do people use WebSockets with Lucee?

I can think of these scenarios:

  1) Applications where the users communicate without Lucee, e.g. Chat -type.

  2) Applications where the users subscribe for information and then Lucee would send them updates, probably via an Event Gateway, e.g. Stock Ticker -type.

In what other ways do you guys use WebSockets with Lucee/CFML?

Igal Sapir
Lucee Core Developer
Lucee.org

On 9/19/2016 1:13 AM, Mark Drew wrote:

Maybe raise a ticket in that GitHub repository? 

Mark Drew
- Sent by typing with my thumbs. 

On 18 Sep 2016, at 22:24, JP <jo...@redtopia.com> wrote:

What's the most recent update on this issue? Are there any recent developments on this issue? I need to implement websockets on Lucee, ideally in a distributed environment, but I'll take a single-server implementation to start with. I ran into this repo, but I couldn't figure out how to implement a receive message callback:





On Tuesday, June 2, 2015 at 10:57:24 AM UTC-6, John Blayter wrote:
Has anyone been able to get websockets to work in Lucee? I have an upcoming project here that I need to start on later this week that would be perfect use case for them but I don't see them supported yet.

Thanks,

John
--
Get 10% off of the regular price for this years CFCamp in Munich, Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€ instead of 210€. Visit https://ti.to/cfcamp/cfcamp-2016/discount/Lucee@cfcamp
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.

To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/0149dafc-73fb-45b1-9788-239a80ec22f8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Get 10% off of the regular price for this years CFCamp in Munich, Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€ instead of 210€. Visit https://ti.to/cfcamp/cfcamp-2016/discount/Lucee@cfcamp
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.

To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/1B66C884-C440-4D6E-A711-C8BF5C59B237%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
Get 10% off of the regular price for this years CFCamp in Munich, Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€ instead of 210€. Visit https://ti.to/cfcamp/cfcamp-2016/discount/Lucee@cfcamp
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.

To post to this group, send email to lu...@googlegroups.com.

JP

unread,
Sep 28, 2016, 4:40:54 PM9/28/16
to Lucee
Is there any production-ready solution to get websockets running on Lucee 5?

Harry Klein

unread,
Sep 29, 2016, 2:51:36 AM9/29/16
to Lucee

Yes, we are using websockets in our CMS and custom projects with Lucee.

We built a custom Java Websockets library – if you are interested, just contact me and I can get you in touch with our developers.

Works very well with many parallel threads, we spent a lot of time on load tests with JMeter.

 

-Harry

--

Get 10% off of the regular price for this years CFCamp in Munich, Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€ instead of 210€. Visit https://ti.to/cfcamp/cfcamp-2016/discount/Lucee@cfcamp
---
You received this message because you are subscribed to the Google Groups "Lucee" group.

To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.


To post to this group, send email to lu...@googlegroups.com.

Igal @ Lucee.org

unread,
Dec 11, 2016, 3:16:18 AM12/11/16
to lu...@googlegroups.com, Igal @ Lucee.org

I just published the Lucee WebSocket Extension as a BETA release. 

Please watch https://www.youtube.com/watch?v=4nC1lMv-QwI for details.  I am a bit short on time ATM, so so I made this video in 1-take (no time for editing). 

Links are in the video description.

I will try to add more information when I have more time.

HTH,


Igal Sapir
Lucee Core Developer
Lucee.org

Risto

unread,
Dec 12, 2016, 5:27:18 PM12/12/16
to Lucee, ig...@lucee.org
Good video

Rory Laitila

unread,
Dec 13, 2016, 8:56:32 AM12/13/16
to Lucee, ig...@lucee.org
Great job Igal, thank you for putting this together!

JP

unread,
Dec 16, 2016, 11:13:11 AM12/16/16
to Lucee
FYI, I spent quite a bit of time with the extension that @Igal wrote. It's definitely worth a look, but be aware that it's not as simple as enabling the extension. To get a robust websocket solution, you would need to write some sort of module that takes advantage of the low-level access to websockets that become available through the extension. Also, the extension is experimental at this point, and it doesn't work with any stable releases, afaik. 

I was able to built what I think is a fairly complete wrapper for the extension that allows your app to manage multiple endpoints and connections within each endpoint. I would be happy to share my code with anyone who is interested.

Brad Wood

unread,
Mar 2, 2017, 10:31:05 AM3/2/17
to Lucee
JP, can you put your work on ForgeBox so anyone else can grab it and install?

Igal @ Lucee.org

unread,
Mar 19, 2017, 2:02:52 PM3/19/17
to lu...@googlegroups.com

FYI:  I published a major update. See
http://dev.lucee.org/t/websockets-in-lucee/1133/33


Igal Sapir
Lucee Core Developer
Lucee.org

--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

Charles Robertson

unread,
May 19, 2017, 11:39:53 AM5/19/17
to Lucee
Hi Igal

I am using Lucee 4.5.3.018

I have downloaded the extension via the link you provided with your YouTube video.
When I try and upload in Lucee Server Admin -> Extensions -> Applications, using the browse field, I get an error, saying that only 'zip' files can be uploaded.

I also see there is now an extension called 'Server Socket' which is not in beta.
Is this extension the same thing? If so, I could install it normally, presumably.
But, it does not look the same???

Also the link you provided for the sample application, does not work. My browser just times out.

Thanks for any help you can provide me!

Reply all
Reply to author
Forward
0 new messages