title: How can access websockets in webworkers?
body: <p>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.</p>
  
  <p>sample stuff what I am trying.</p>
  
  <pre><code>var ws = new WebSocket(url);
  var worker=new Worker(worker.js);
  
  ws.onmessage=function(e){
  worker.postMessage({ws:ws,data:e.data});
  }
  </code></pre>
  
  <p>worker.js  </p>
  
  <pre><code>onmessage=function(e){
    var ws=e.data.ws;
    var data=e.data.data;
    var request=someProcess(data);
  
    ws.send(request);
  }
  </code></pre>