Cypress web sockets error: 'Sec-WebSocket-Accept' header is missing - vue.js

I am trying to test a VueJs application with Cypress.
Everything works well except the websocket connection that fails with the message:
Error during WebSocket handshake: 'Sec-WebSocket-Accept' header is missing
On dev or deployed, it works without issue and the 'Sec-WebSocket-Accept' header is present but no clue why it fails with Cypress.
Any idea?

Related

Error in React Native using axios - Error: Network Error

I'm using axios on my React Native APP and i'm getting this error on my post request -> [Error: Network Error]
A few informations that are relevants:
This error not happen on IOS (same project)
API is hosted on Azure.
This error starts to happen after turn on WAF on API.
When I make the same call on postman, I receive the follow message: Unable to verify the first certificate (but the request works because SSL certificate verification is disabled.
"react-native": "^0.67.5",
"axios": "^0.26.1",
node: 14.7.0
I tried to disabled SSL Verification on Android, but I don't wanna follow this approach, because it's a security config.

Load Runner => Action.c(1279): Error -26630: HTTP Status-Code=401 (Unauthorized) IIS

I'm receiving this error from load runner
Action.c(1279): Error -26630: HTTP Status-Code=401 (Unauthorized) for
xxxxxxxx
Even when I used browser in same time of using the tool I get 401 error.
ASP.NET Core application
IIS
even I used browser in same time of using the tool I get 401 error
What's your theory of what is happening and what testing have you done to validate your theory?

testcafe's Chrome refusing POST request to api (ipfs-http-client + infura)

I'm trying test an app that uses ipfs-http-client module + infura.io as http provider. It doesn't work in testcafe's chrome (but it works everywhere else, like if I manually test my app in chrome). Here's the console error I'm getting:
POST http://192.168.1.33:62108/gkheFCZHj/https://ipfs.infura.io:5001/api/v0/add?stream-channels=true 400 (Bad Request)
I'm not sure what testcafe uses, maybe a proxy or something? But it looks like https://ipfs.infura.io:5001/api/v0/add?stream-channels=true is refusing the request. Any way to fix it? I'd like to keep using testcafe.

Proxy Error in RoR web application

I have an RoR app and while deleting content from this app, I am encountering the following error. Although when I refresh the webpage after this error, the content is deleted in the request.
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request POST /abc/xyz/source/23.
Reason: Error reading from remote server.
This is an Apache Web server.
Can you please help me find what could be the reason behind this ?
The invalid response from an upstream server is generated when Apache web server does not receive a valid HTTP response from the upstream server.
The reason may be because of the following things;
The application did not respond in time and the request from Apache timed out.
May be network device blocking the request.
You need to add/increase the timeout limit in httpd.conf file of your application.

Using stomp.js over sock.js with ActiveMQ-Apollo does not seem to work

I am working through some samples in the ActiveMQ-Apollo installation and playing around with the examples/websocket.
In this file, Stomp.js is being used to establish connection:
client = Stomp.client(url);
The example works fine and I am able to see the messages being sent and received. The issue, is that Stomp uses default WebSocket which may not be available at times. So, I wanted to integrate with SockJS client library. According to the example for StompJS on this page (http://jmesnil.net/stomp-websocket/doc/) it should be possible with this code:
<script src="http://cdn.sockjs.org/sockjs-0.3.min.js"></script>
<script>
// use SockJS implementation instead of the browser's native implementation
var ws = new SockJS(url);
var client = Stomp.over(ws);
[...]
</script>
The above code appears to execute correctly, however, later I see the following errors:
XMLHttpRequest cannot load ws://mylocaldomain.com:61623/info. Cross origin requests are only supported for HTTP. sockjs-0.3.js:807
Uncaught Error: NetworkError: DOM Exception 19
Then, I see the debug window show this message:
Opening Web Socket...
Whoops! Lost connection to undefined
I am serving the page from mylocaldomain.com:80, and the ActiveMQ Apollo server is running on the same machine, but listening on port 61623. I have also grabbed the latest version of StompJS (from dist directory on github) as well as SockJS directly from cdn.sockjs.org.
I tried this example on latest Chrome and Firefox (on OSX) and the same thing occurs. No connection is established.
Again, going back to the standard example which ships with the Apollo works fine, but I would like to find out why StompJS over StockJS is failing.
Has anyone seen this issue?
Thanks.
-AP_
You need to modify the ActiveMQ-Apollo web configuration to support Cross-Origin-Resource-Sharing (CORS) as described here:
Enabling CORS
W3C CORS Specification
Basically the server needs to do the following things:
Support the HTTP OPTIONS request (aka CORS pre-flight request) that is sent by browsers for Cross Domain requests. This includes responding to the OPTIONS request with:
Access-Control-Allow-Origin header (for example: "*" which means allow all origins)
Access-Control-Request-Method header (for example: "GET, POST, PUT, DELETE, OPTIONS")
Access-Control-Allow-Headers (for example: "X-Requested-With,Origin,Content-Type, Accept")
The handling of HTTP OPTIONS can typically be done using a single Web Filter matching filter pattern "/*".
See also "cors_origin" WebSocket connector URL query parameter supported by ActiveMQ Apollo 1.7