Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

203
Views
Why Websocket connection is disconneting after sending message on iOS 15 devices?

I am building a website based on web socket communication. Its is working fine until iOS 14 but started breaking from iOS 15. Web socket java script client is able to open connection to server, but upon trying to send a message, the connection is getting closed. Following is my html and JS code.

function start_websocket() {
  connection  = new WebSocket("wss://localhost/wss/");
  connection.onopen = function () {
    console.log('Connection Opened');        
  };
  connection.onerror = function (error) {
    console.log('WebSocket Error ' + error);
  };
  connection.onclose = function(){
    console.log("Closed");
  };
  connection.onmessage = function (e) {
    console.log("Message Received :" + e.data);
  };
 }

function myFunction() {
   var testText = document.getElementById("testText");
   if (testText.value != "" && connection.readyState === connection.OPEN) {
      connection.send("Test");
   }
}
start_websocket();

myFunction() is an on-click event of a button.

A Java Websocket server is used, which will decode and send the messages based on the Data framing in https://datatracker.ietf.org/doc/html/rfc6455#section-5.

Saw different articles on the Web, but didn't found a solution to this issue. Any suggestions are much appreciated. Looking forward for your answers

Thanks in advance.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!