Open comodoro opened 2 years ago
Hi Comodoro are you still looking for this
Yes, my attempts were unsuccessful as I have zero experience with socket.io and rusty with JavaScript.
On Sat, 12 Mar 2022, 23:41 Justin Riddiough, @.***> wrote:
Hi Comodoro are you still looking for this
— Reply to this email directly, view it on GitHub https://github.com/coqui-ai/STT-examples/issues/27#issuecomment-1065977951, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHB6GWER6NZ6SD6YMS27HDU7UMR5ANCNFSM5LRY2NOQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you authored the thread.Message ID: @.***>
Try this in the server.js:
const app = http.createServer(function (req, res) {
const headers = {
'Access-Control-Allow-Origin': '*',
'Access-Control-Max-Age': 2592000, // 30 days
/** add other headers as per requirement */
};
res.writeHead(200, headers);
res.write('STT');
res.end();
});
const io = socketIO(app, {});
io.set('origins', '*:*');
The
web_microphone_websocket
example works for localhost, but on a domain there were CORS errors from thesocket.io
code, e.g. Chrome:Several recipes from SO and the socket.io docs did not work, perhaps someone with better JS knowledge might help.