Websocket implementation not working in Apache Ofbiz - websocket

I am checking the Websocket implementation in Apache Ofbiz.
I followed the parent ticket OFBIZ-7073 and its child tickets.
But I am getting the following error-
ExamplePushNotifications.js:23 WebSocket connection to 'wss://localhost:8443/example/ws/pushNotifications' failed: Error during WebSocket handshake: Unexpected response code: 404
I think that the request is redirecting to control servlet rather than tomcat server. Therefore IMO, we need to make some changes in example/web.xml.
How should I proceed?
Thanks in advance!

Related

How can I forward server response error to client with Jetty proxyservlet.Transparent?

I have implemented a proxy extending jetty's ProxyServlet.Transparent.
However upon testing I noticed there is a difference on error messages the user sees when the server returns an error.
For example, when connecting directly to one of our application server with an invalid user credential, the server should return something more specific with instructions on the auth as we have set it this way. When connecting to the proxy server the error is in its most generic form like Authentication failed: Unauthorized
I suspect at some stage jetty checks on the server response and set the proxy response with minimal information so I am looking into the Transparent class code and its parent classes to find which method I can override to intercept the original server response and forward the information in the proxy response, assuming my understanding on these two responses are correct.
Thanks for the help.

javax.websocket.DeploymentException: The HTTP response from the server [HTTP/1.1 200 OK ] did not permit the HTTP upgrade to WebSocket

I have question, i'm make application REST API spring for fingerprint using websocket, i have already tried to connect websocket and that's work using button click from interface but after i tried to connect to websocket from localhost:8080/filename/1 url bar always showing, did not permit the HTTP upgrade to websocket can someone help me, thanks in advance.

Spring Websocket 400 Error: Handshake failed due to invalid Upgrade header: null

I am using wss (secured web sockets) with spring 4.2.x from backend and STOMP for javascript client. I can run it successfully under http, but failed when under https.
The only error I met is:
ERROR o.s.w.s.s.s.DefaultHandshakeHandler - Handshake failed due to invalid Upgrade header: null
The JS error is:
WebSocket connection to 'wss://.example.com/.../websocket' failed: Error during WebSocket handshake: Unexpected response code: 400
I googled a lot and understand that I should do some configuration on wildfly to make it support wss requests. But I don't know how. Thanks in advance if someone can give any idea!

Strophe to Openfire: Error during WebSocket handshake: Unexpected response code: 302

I am writing a simple chat client (using strophe) which connects to my Openfire server. Strophe works successfully with BOSH, but for some reason cannot connect using websockets.
I have installed the latest version (websockets-0.0.0.6) of "WebSockets Plugin" plugin for OpenFire, using the default path "ws". My client url is ws://my-server:7070/ws.
I get the following error in my browser console:
WebSocket connection to 'ws://localhost:7070/ws' failed: Error during
WebSocket handshake: Unexpected response code: 302
I look at other related post (stackoverflow.com/questions/22983302/strophe-failed-to-connect-openfire-by-websocket) but have not been successful.
Has anyone come across this problem before?
Any help would really be appreciated.
Thanks in advance.
I'm assuming you were using the latest version of Strophe. The openfire-websocket is developed against with older version Strophe 1.0 . They are not capable now.
You can take a look at https://community.igniterealtime.org/thread/53783

Getting updates via xively websockets

I am trying to subscribe to datastream updates via the xively-js javascript library.
However, all I am getting is a 503 error right after creating the websocket:
WebSocket connection to 'ws://api.xively.com:8080/' failed: Unexpected response code: 503
The same error is produced by the xively-js sample-app at
http://xively.github.io/xively-js/sample-app/
Both IE10 and Chrome give the same result.
I can't seem to find any working xively websocket sample. Does somebody have any?
I have found the answer to my own question. It looks like non-secure websockets don't work for some reason.
The secure version wss://api.xively.com:8094 is working fine.

Resources