typicode / hotel

🏩 A simple process manager for developers. Start apps from your browser and access them using local domains
MIT License
9.98k stars 426 forks source link

Allow CORS on SSE #329

Closed macav closed 5 years ago

macav commented 5 years ago

Hi there, I would like to add a log viewer into hotelier and I would need to connect to the EventSource from another origin. Would it be possible to integrate this PR so that I can do this? Thanks!

coorasse commented 5 years ago

As an Hotelier user I'd really ❤️ to see this happening

typicode commented 5 years ago

Hi @macav,

Sorry for the delay.

Except if I'm wrong, this mean that any site can call this endpoint. My concern is that technically example.com could read logs from hotel.localhost?

Since it's an Electron app, wouldn't it be possible to use Node code to avoid CORS issue and proxy events via from Hotel to Hotelier API to Hotelier front?

macav commented 5 years ago

@typicode thanks for the hint and your time to look into this! I managed to get it working by subscribing to the events in Node and then propagate it to frontend :) I'm closing this one

typicode commented 5 years ago

Great :)