occ-ai / obs-localvocal

OBS plugin for local speech recognition and captioning using AI
https://obsproject.com/forum/resources/localvocal-live-stream-ai-assistant.1769/
GNU General Public License v2.0
340 stars 27 forks source link

Error 404 (CORS header ‘Access-Control-Allow-Origin’ missing) when calling /translate #77

Closed jojo58fr closed 3 months ago

jojo58fr commented 3 months ago

Hello !

I want to build a streamelements widget that use LocalVocal. I have test my request through insomnia, it get me a 200 OK with the translation but when i use this code on a widget streamelements, i've got a CORS Error.

Would it be possible to correct this issue ? Thank you very much for all your hard work on LocalVocal.

const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"text":"Bonjour monde.","source_lang":"fr_Latn","target_lang":"eng_Latn"}'
};

fetch('http://127.0.0.1:18080/translate', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));

image

On the streamelements widget: image

jojo58fr commented 3 months ago

wrong repository, my bad