nuxt / content

The file-based CMS for your Nuxt application, powered by Markdown and Vue components.
https://content.nuxt.com
MIT License
3.01k stars 607 forks source link

Unable to modify websocket url #2462

Open snakysnake opened 6 months ago

snakysnake commented 6 months ago

Environment


Reproduction

Try to change websocket url to your desired value, for example 127.0.0.1 or your local network device ip

Describe the bug

I am trying to change the url of the websocket. I was able to locate where the url is being created: /node_modules/@nuxt/content/dist/runtime/composables/web-socket.mjs (line 57 ... ctrl+f 'const wsURL =' ....)

const wsURL =  `${useRuntimeConfig().public.content.wsUrl}ws`;

I tried a few times to change the value of the accessed env variable but was unable to. My approaches were both to modify the .env and to write to nuxt.config.js at the "specified location" (public.content.wsUrl) but somehow my changes are ignored. Either I am missing for example some sort of overwrite that happens or I am somehow misunderstanding something else here, but even though I tried I was unable to find a way to set my wanted variable value here.

Please help me out and let me know how to change it, or whether the change not being recognized is a bug.

Dear regards, Snakysnake

Additional context

I changed it manually just by overwriting the value inside the file, but for obvious reasons, this is not a longterm solution.

Logs

No response

farnabaz commented 5 months ago

You can modify watch url via watch option in module config. Also take a look at listhen options