Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multi-domain setups and create a proxy middleware for each domain #40

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mmunz
Copy link
Contributor

@mmunz mmunz commented Jan 26, 2023

No description provided.

@tyler36
Copy link
Collaborator

tyler36 commented Jan 26, 2023

@mmunz Thanks for PR.

Could you some steps here I can follow so I can test it?

@mmunz
Copy link
Contributor Author

mmunz commented Jan 27, 2023

@tyler36 i created a ddev test setup here: https://github.com/mmunz/browsersynctest/tree/multiple-domain-support

It is a ddev setup with an additional hostname and two docroots.

To test it do:

@tyler36
Copy link
Collaborator

tyler36 commented Feb 1, 2023

@mmunz

I had a look at the PR today.
Using this ddev get https://github.com/mmunz/ddev-browsersync/tarball/support-multidomain-setups

After running it, I opened https://browsersynctest.ddev.site:3000/ & https://browsersynctest2.ddev.site:3000/;

Changes made to browsersynctest1/index.html reload both pages.
Changes made to browsersynctest2/index.html triggers nothing.

Is that the expected behavior?

@tyler36
Copy link
Collaborator

tyler36 commented Feb 1, 2023

@mandrasch would this have helper for your use case (#27) ?

@mmunz
Copy link
Contributor Author

mmunz commented Feb 14, 2023

@tyler36 i have to look deeper into this, but i suspect this is same strange caching issue (browser cache or even the http-proxy-middleware).

@mandrasch
Copy link

mandrasch commented Feb 14, 2023

@mandrasch would this have helper for your use case (#27) ?

Can't really say. While reading through the steps provided by @mmunz I just noticed that I never used the ddev browsersync command...

I just installed ddev-browsersync to open up the port via the docker-compose file...In LaravelMix browsersync was controlled by the package itself (https://laravel-mix.com/docs/6.0/browsersync), see also my answer #27 (comment). Guess my issue was more a docs-related one to LaravelMix integration.

Much success solving this!

@mmunz
Copy link
Contributor Author

mmunz commented Feb 15, 2023

@tyler36 The problem was, that in the demo project the public folder was not properly watched. I've updated https://github.com/mmunz/browsersynctest/tree/multiple-domain-support to watch for files in public in browser-sync.js now.

@tyler36
Copy link
Collaborator

tyler36 commented Feb 1, 2024

Sorry for the delayed response.
Is this still valid and a "good" approach?

@mmunz
Copy link
Contributor Author

mmunz commented Mar 29, 2024

@tyler36 well, it's the best solution for the problem i came up with. I'm also using it in my own multidomain projects. The downside is that it adds a bit of complexity.

But i'd love to hear from others, if they use this approach and if it works, or if there exist better solutions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants