Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8347365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:20:35+00:00 2026-06-09T07:20:35+00:00

I need to send websocket calls from webworkers, how can i get it. I

  • 0

I need to send websocket calls from webworkers, how can i get it. I dont think so is there any support from the user agents. if support available please give me an example to do this.

sample stuff what I am trying.

var ws = new WebSocket(url);
var worker=new Worker(worker.js);

ws.onmessage=function(e){
worker.postMessage({ws:ws,data:e.data});
}

worker.js

onmessage=function(e){
  var ws=e.data.ws;
  var data=e.data.data;
  var request=someProcess(data);

  ws.send(request);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T07:20:36+00:00Added an answer on June 9, 2026 at 7:20 am

    In the worker ws is a string deserialized JSON object, not a WebSocket object. You can’t pass objects with methods to workers which means the worker will need to reply to the main thread and the main thread does the ws.send(worker_response).

    I suspect the error you are getting is a DATA_CLONE_ERR exception or similar due to WebSocket objects not being JSON serializable through the structured clone algorithm.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need send certain attributes(say, human readable user name) from server to client after
Need to send/receive text messages between user and system. Any solutions available online? Is
We need send h264 from flash to Wowza and after to vlc by RTSP
I need to send video stream between 2 mobile devices. Bada has no support
I need to send an HTML report with images from an application. The report
I need to send some arguments from the iPhone to a php in the
I need to send emails from my web application (on account creation, password reset,
I need to send some information from my PC to an Arduino. I tested
I need to use websockets to send a view so it can be loaded
I need to consume a JSON-formatted data stream via WebSocket, and send the data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.