I have some lucee code which is websockets extention added to lucee 5.3 version, in my apache setuip i enabled the proxy for the websockets as my version for apache is 2.4 and above.
So my question is regarding the virtual host file
<VirtualHost *:443>
ServerName calendar.myworlswebsite.com
RewriteEngine on
RewriteCond ${HTTP:Upgrade} websocket [NC]
RewriteCond ${HTTP:Connection} upgrade [NC]
RewriteRule .* "wss:/localhost:3000/$1" [P,L]
ProxyPass / https://localhost:3000/
ProxyPassReverse / https://localhost:3000/
ProxyRequests off
</VirtualHost>
now my website has address of: calendar.myworlswebsite.com
where it is loading the localhost:3000, do i need to write localhost:3000 or my actual website name like
https://calendar.myworlswebsite.com/
and in my server i have the ws folder and inside i have a chat folder and then some cfm files
so my ws folder is in
/mnt/efs/home/leagues/ws/chat/index.cfm
and my application.cfc is like this
component {
this.name = "websocket_chat";
function onApplicationStart(){
// This must be called only ONCE, so we do it here.
WebsocketServer("/ws/chat/{channel}", new ChatListener());
}
}
and when i run it i get an error
var wschat = new WebSocket(protocol + document.location.host + endpoint);
on this line saying
index.cfm?username=iamtest:17 WebSocket connection to 'wss://calendar.myworlswebsite.com/ws/chat/default' failed:
index.cfm?username=iamtest:19
Event {isTrusted: true, type: 'error', target: WebSocket, currentTarget: WebSocket, eventPhase: 2, …}
index.cfm?username=iamtest:19
CloseEvent {isTrusted: true, wasClean: false, code: 1006, reason: '', type: 'close', …}
not sure how should i fix it, i tried everything i could, website is already running on https.
the code i tried above for websockets
also in my tomcat, i have already enabled the sessionfilter piece of code