adonisjs / transmit

A Server-Sent-Event module for AdonisJS
MIT License
71 stars 5 forks source link

Transmit doesn't work with domain setup #16

Closed Steveperi closed 6 months ago

Steveperi commented 6 months ago

Package version

adonis 6

Describe the bug

I have the following error. Screenshot 2024-04-10 at 11 19 35 AM

When I setup the route with this code

router.get('/', '#controllers/sites_controller.index').domain(process.env.SITE_DOMAIN!)

transmit doesn't work, but it works when remove

.domain(process.env.SITE_DOMAIN!)

Here is the repository repo where can you reproduce the problem.

Thank you

Reproduction repo

https://github.com/Steveperi/adonis-transmit

RomainLanz commented 6 months ago

Can you try with v0.6.0?

You can now customize the route registration inside the config/transmit.ts file.

Steveperi commented 6 months ago

Can you try with v0.6.0?

You can now customize the route registration inside the config/transmit.ts file.

Hello

I updated the package to v.0.6.0 but not working. I have the same error.

RomainLanz commented 6 months ago

Have you changed the configuration to use your custom domain as shared in the release note?

Steveperi commented 6 months ago

Have you changed the configuration to use your custom domain as shared in the release note?

I'm sorry my mistake. It works for one domain. My app has multiple domains, how can I do that?

RomainLanz commented 6 months ago

You wont have multiple Transmit endpoint, choose one and stick with it. In your case, you should select the TLD localhost since all others will be able to access it.

Steveperi commented 6 months ago

You wont have multiple Transmit endpoint, choose one and stick with it. In your case, you should select the TLD localhost since all others will be able to access it.

Ok I thought that and I tried it, but from client side I have cors errors.

RomainLanz commented 6 months ago

This is something you have to fix on your side; it is not related to Transmit.

Steveperi commented 6 months ago

This is something you have to fix on your side; it is not related to Transmit.

Ok, but I think is related to the transmit client package. I'll try to make it work.

Thank you for your time