I am just testing Primefaces push on your showcase, it is used to work when the page was using http only. Now that it is using https it doesn't work anymore, and javascript console shows this error
Code: Select all
Mixed Content: The page at 'https://www.primefaces.org/showcase/push/counter.xhtml' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://www.primefaces.org:8080/showcase/primepush/counter?X-Atmosphere-tracking-id...ransport=websocket&X-Atmosphere-TrackMessageSize=true&X-atmo-protocol=true'. This request has been blocked; this endpoint must be available over WSS.
av @ push.js.xhtml:1
push.js.xhtml:1 Uncaught DOMException: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS.
at av (https://www.primefaces.org/showcase/javax.faces.resource/push/push.js.xhtml?ln=primefaces&v=6.1-SNAPSHOT:1:12625)
at af (https://www.primefaces.org/showcase/javax.faces.resource/push/push.js.xhtml?ln=primefaces&v=6.1-SNAPSHOT:1:14751)
at aa (https://www.primefaces.org/showcase/javax.faces.resource/push/push.js.xhtml?ln=primefaces&v=6.1-SNAPSHOT:1:6118)
at AtmosphereRequest.execute (https://www.primefaces.org/showcase/javax.faces.resource/push/push.js.xhtml?ln=primefaces&v=6.1-SNAPSHOT:1:36292)
at Object.a.subscribe (https://www.primefaces.org/showcase/javax.faces.resource/push/push.js.xhtml?ln=primefaces&v=6.1-SNAPSHOT:1:36919)
at connect (https://www.primefaces.org/showcase/javax.faces.resource/push/push.js.xhtml?ln=primefaces&v=6.1-SNAPSHOT:1:45029)
at c.init (https://www.primefaces.org/showcase/javax.faces.resource/push/push.js.xhtml?ln=primefaces&v=6.1-SNAPSHOT:1:44940)
at new c (https://www.primefaces.org/showcase/javax.faces.resource/core.js.xhtml?ln=primefaces&v=6.1-SNAPSHOT:5:437)
at Object.createWidget (https://www.primefaces.org/showcase/javax.faces.resource/core.js.xhtml?ln=primefaces&v=6.1-SNAPSHOT:1:5001)
at Object.cw (https://www.primefaces.org/showcase/javax.faces.resource/core.js.xhtml?ln=primefaces&v=6.1-SNAPSHOT:1:4822)
How can I establish a socket connection using WSS?