Websocket extension session scope not passed in for secure websocket


#1

I’ve been trying to get my websocket to work, but was having lots of difficulties using a url rewrite and using https in IIS. So I setup a secure tomcat port to directly connect to the tomcat server for the secure websocket. I am finally getting a 101 status code, and logging the message it says that it opens a connection, but none of my messages are received. I checked the logs and found the below error, which makes me assume something is happening with the extension because (I believe) these parameters are passed from within the extension into my cfc onOpen method.

Looking over the error, I also noticed this class call, WsHttpUpgradeHandler.java, and it made me think maybe it is related to using secure sockets wss/https? I have to use wss though because the website is https and it won’t allow a ws connection, the browser throws a security error.

Any help is appreciated.

lucee.runtime.exp.ExpressionException: The parameter SessionScope to function onOpen is required but was not passed in.
	at lucee.runtime.type.UDFImpl.defineArguments(UDFImpl.java:173)
	at lucee.runtime.type.UDFImpl._call(UDFImpl.java:336)
	at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:211)
	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:698)
	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:580)
	at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1935)
	at net.twentyonesolutions.lucee.app.LuceeAppListener.invokeWithNamedArgs(LuceeAppListener.java:118)
	at net.twentyonesolutions.lucee.websocket.WebsocketUtil.invokeListenerMethodWithNamedArgs(WebsocketUtil.java:77)
	at net.twentyonesolutions.lucee.websocket.WebsocketUtil.invokeListenerMethodWithNamedArgs(WebsocketUtil.java:103)
	at net.twentyonesolutions.lucee.websocket.LuceeEndpoint.onOpen(LuceeEndpoint.java:57)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.init(WsHttpUpgradeHandler.java:133)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:844)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1434)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)

#2

After more debugging and research into my issue, I think the above stack trace is more or less my fault. I set the sessionscope argument to required which throws that error. When removing the required attribute and dumping out the arguments, I found that the sessionscope is set to null. I tested in all browsers and Chrome works, but firefox and IE edge does not work. Does anyone know what might cause a specific browser to work, but not the others? Also, if I can provide any information that might help troubleshoot this, please let me know.


#3

I’ve been back at this project again trying to figure it out. I did find that it was actually working for Chrome and FireFox. It is only IE Edge that appears to not be working. Edge does kind of work, but the problem is that it does not link the existing session to the websocket. For my application this throws an error because I need session data in OnOpen. I setup tests for both WS and WSS and get the same results. Has anyone had any luck getting a websocket working with IE Edge?