jmarshall-com opened a new issue, #1881:
URL: https://github.com/apache/cordova-android/issues/1881
# Bug Report
## Problem
A call of `new WebSocket('wss://echo.websocket.org')` (a public testing
server) results in its `onerror` handler being called, with an empty error
message.
### What is expected to happen?
The websocket should open, and the `onopen` handler should be called
### What does actually happen?
The websocket does not open, and instead calls the `onerror` handler.
`JSON.stringify()` of the error argument is `{"isTrusted":true}`.
## Information
<!-- Include all relevant information that might help understand and
reproduce the problem -->
### Command or Code
This is the entire `index.js`:
```
document.addEventListener('deviceready', onDeviceReady, false);
function onDeviceReady() {
const ws = new WebSocket('wss://echo.websocket.org');
ws.onopen = () => alert('WebSocket connected!') ;
ws.onerror = (error) => alert('WebSocket error: '+
JSON.stringify(error)) ;
ws.onclose = (event) => alert('WebSocket closed: '+ event.code+
event.reason) ;
}
```
The only other change I made after `cordova create` was to add `connect-src:
*` to the CSP `<meta>` tag in `index.html`.
### Environment, Platform, Device
<!-- In what environment, on what platform or on which device are you
experiencing the issue? -->
This is on a Mac mini, using an Android emulator from Android Studio.
### Version information
<!--
What are relevant versions you are using?
For example:
Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins
Other Frameworks: Ionic Framework and CLI version
Operating System, Android Studio, Xcode etc.
-->
Cordova 12.0.0 ([email protected])
Cordova Android 14.0.1
no plugins
MacOS Tahoe 26.2
Android Studio: Panda 1 | 2025.3.1 Patch 1
Build #AI-253.29346.138.2531.14876573, built on February 11, 2026
Runtime version: 21.0.9+-14649483-b1163.86 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Android emulator: Pixel 7, Android 15.0, API 35
## Checklist
<!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]