WebSocket error 302, after composer update - websocket

Ratchet worked perfect until I updated my composer, after that it produce this error on chrome
WebSocket connection to 'wss://mysite.com/wss2/' failed: Error during WebSocket handshake: Unexpected response code: 302
on Mozilla
Firefox can’t establish a connection to the server at wss://mysite.com/wss2/.
httpd.conf
ProxyPass /wss2/ ws://myIP:8888/
socket.js
var conn = new ab.Session('wss://mysite.com/wss2/',
Does anyone know what might be the problem? thanks!

Related

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!

XHR from another domain to a https server

I have a server on heroku, using https certificate. Now I am trying to build an IOS/Android app using Ionic framework and make connection to that heroku server.
The error when I do it is
"ERR CONNECTION REFUSED" when I am trying to do https://example.com/auth
And when I change it to http instead, the error is
XMLHttpRequest cannot load http://example.com/auth. The request was redirected to 'https://www.example.com/auth', which is disallowed for cross-origin requests that require preflight.
Thanks for any help.

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.

open websocket connection firefox addon

Is it possible for a firefox addon to establish a websocket connections?
When I try:
var wsUri = "ws://echo.websocket.org/";
var ws = gBrowser.contentWindow.window.WebSocket ||
gBrowser.contentWindow.window.MozWebSocket;
var websocket = new ws(wsUri);
In the Error Console the message says
Error: Firefox can't establish a connection to the server at ws://echo.websocket.org/.
Currently, it seems the only option is to proxy your WebSocket messages through a PageWorker. There is an example of how to do this on this website:
http://austinhartzheim.me/blog/4/websockets-firefox-sdk-addons/

Resources