Repository navigation
Replies: 2 comments
|
seems like maybe theres a way to pass a I'm not a JS expert by any means, any and all help/pointers/tips are appreciated. im also having a hard time believing I'm the first to pioneer this path, so I'm assuming that I'm doing many things wrong. |
|
You can separate the browser's public hostname from the address Vite binds to by sharing the main HTTP server with HMR. In the Vite 5.4.11 version you listed, omitting For TLS termination at ingress, try this server configuration: server: {
host: '0.0.0.0',
port: 3030,
strictPort: true,
hmr: {
protocol: 'wss',
host: 'myapp.com',
clientPort: 443,
path: '/hmr/'
}
}Then route both There is also a TLS mismatch in the configuration shown: the ingress annotation says the upstream is HTTPS, but To verify, check that the browser opens I checked this against Vite 5.4.11's WebSocket implementation and Vite's HMR documentation, but have not reproduced your kind/ingress setup. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
I'm running a local
kindcluster on my macbook and trying to deploy my Sveltekit app. Its working great outside of k8s, but I need to setup a bunch of ancillary things and its time to upgrade the stack.In order to fully test my stack, I require TLS to work and use
mkcertto generate local certificates, and also havecert-managerconfigured to provide self-signed certificates.I cannot figure out the magical incantation to get both node+HMR to bind to IPv4 AND also provide a client configuration pointing at the dns-name, (not 0.0.0.0).
So if in my vite config I set things to bind to 0.0.0.0, I get IPv4, but then my client sees
or
if i set vite to use my dns name, it will bind to IPv6, and then nothing works. Wish there was a way to provide both a bind/listen parameter as well as the hostname to provide to the client so that it would understand that my Ingress controller is terminating TLS. (if I enable passthru TLS, then its L4 and can't do the ws connection upgrade which is L7).
Reproduction
ingress
service
deployment
Logs
No response
System Info
inside container
Severity
blocking all usage of SvelteKit
Additional Information
vite.config.ts
If i flip to use the dns name, it binds wrong
All reactions