fix: use listhen's publicUrl if available#3500
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
Deploying content with
|
| Latest commit: |
9463608
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://5c4ecc2f.content-f0q.pages.dev |
| Branch Preview URL: | https://fix-websocker-public-url.content-f0q.pages.dev |
|
Great work! I verified this works, you just have to specify |
|
@dargmuesli I think this PR also affect/help you, but it should not break the current behavior. |
| // Register ws url | ||
| ;(nitro.options.runtimeConfig.public.content as Record<string, unknown>).wsUrl = listener.url.replace('http', 'ws') | ||
| const publicConfig = nitro.options.runtimeConfig.public.content as Record<string, unknown> | ||
| publicConfig.wsUrl = (websocketOptions.publicURL || listener.url).replace('http', 'ws') |
There was a problem hiding this comment.
publicConfig.wsUrl = (websocketOptions.publicURL || process.env.publicURL || listener.url).replace('http', 'ws')
to use option --publicURL defined by the nuxt dev command.
There was a problem hiding this comment.
Have you tries this?
Public URL of websocket and Nuxt are different, since the module creates its own server for websocket, using same publicURL will cause issue.
There was a problem hiding this comment.
It’s actually only the port that is different, not the public URL.
There was a problem hiding this comment.
It’s actually only the port that is different, not the public URL.
We are passing the whole url to client and we don't change the port. So sharing same url means calling to the same port.
We can do it by adding port to publicUrl in publicConfig.wsUrl = (websocketOptions.publicURL || listener.url).replace('http', 'ws') but the end result will not be same.
|
Laravel Valet proxies allow binding a domain to a service running on a specific port, but they don’t support handling multiple services with different ports. Example: That’s why I’d rather keep using |
🔗 Linked issue
❓ Type of change
📚 Description
📝 Checklist