-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[9.x] Added support for custom proxy urls #43273
Conversation
Added the support for the `app.vite_hot_proxy_url` config. This config will be used for the base url of the tag generated with the `@vite` directive
Will let @jessarcher review this - @jessarcher please mark as ready for review when you're ready for me to take a look |
Hi @gsguglielmo, thanks for the PR. I think before we look at adding this customisation, it would be good to see if we can get your custom host into the hot file itself. Vite allows you to configure where its client should look for the HMR server, and the Laravel Vite plugin also respects this since v0.3. Try adding the following to your Vite config: export default defineConfig({
// ...
server: {
hmr: {
// protocol: 'wss', // Only if you need a https URL and the Vite server is not running on HTTPS
host: 'your-custom-host',
},
},
}); If you need to customise the port, you may specify the |
The host part does seem to solve part of the issue, the hostname part od the I've tried the If you set For the port part of the |
Hi @gsguglielmo, I'd be open to updating There is already a PR at laravel/vite-plugin#63 that I will look at merging. |
@gsguglielmo because the PR @jessarcher mentioned has been merged, does that solve your issue and should we close this one? |
Going to close this as laravel/vite-plugin#63 is merged and should hopefully address the issue. |
Implementation of this feature #43262
This pull request adds the option to manually specify the base url of the vite development server, so it can be used behind a reverse proxy.
If the config option
app.vite_hot_proxy_url
is present, all tags generated with the@vite
directive, will have the specified value as it's base URL.Mix has a similar feature with
app.mix_hot_proxy_url
.