Open bentruyman opened 4 years ago
The HMROptions
should include https
as well (just like the ΛServerOptions` do).
https://github.com/parcel-bundler/parcel/blob/c8d127623e419f23b6216d3fc68e1d45adeecbd0/packages/core/parcel/src/cli.js#L287-L301
Then it needs to be passed to the server as well here (currently via ...serve
):
https://github.com/parcel-bundler/parcel/blob/c8d127623e419f23b6216d3fc68e1d45adeecbd0/packages/reporters/dev-server/src/ServerReporter.js#L27-L40
Is this issue up for grabs? If yes, I would love to contribute.
Sure! @parulc7
How can I make HMR work if I run a site under https://
but parcel never runs in HTTPS mode for watch?
Within the browser, it tries to connect with wss
but apparently, watch
mode doesn't speak HTTPS and I also cannot have SSL termination from a reverse proxy on the host when --host
doesn't seem to work to bind to a specific IP but always listens on all interfaces making it impossible for a reverse proxy to listen to the same port to proxy to parcel with plain HTTP protocol.
Adding --hmr-connect
option as I've explained in another issue seems to solve these problems.
I am also having problems with valid HTTPSOptions
in my ServerOptions
, https and the injected wss
WebSocket not connecting (Status in my Network tab is Finished
)
I still have this problem, when using "--https" and/or "--cert PATH --key PATH" on parcel2 its not connection with wws. I can still connect with ws:// (see screenshot)
parcel watch --https --cert ~/cert.pem --key ~/key.pem"
π bug report
parcel watch
doesn't appear to use the--cert
or--key
flags, though its help output states it supports them. I don't know that the--https
flag is affecting anything either.Not sure if this is related to the recent work done in #4417.
π€ Expected Behavior
Both of the above commands should result in an HMR server starting up on the default port, in "HTTPS mode", using the specified cert and private key.
π― Current Behavior
When running the following:
Parcel starts up an HTTPS HMR server on port
1234
using the certificate and private key specified.parcel watch
also states it supports the--cert
and--key
flags. However, when running the following:A non-HTTPS HMR server is started up.
π Possible Solution
π¦ Context
Being able to specify a custom cert for
watch
is beneficial in the same ways it is forbuild
. For example, it lets one setup local environments testing with E2E TLS encryption, while still allowing the convenience of Parcel's great HMR support.π Your Environment