Webpack Dev Server running on HTTPS/Web Sockets Secure

前端 未结 6 878
無奈伤痛
無奈伤痛 2020-12-02 18:19

Normally in developer mode Webpack runs using HTTP. There is usually a web server serving content through HTTP and webpack using http/websockets on a separate port.

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-02 18:38

    this for TEST environment only:

    you need to configure your webpack-dev-server as follows:

    webpack-dev-server --https --cert ./cert.pem --key ./key.pem

    The easiest work around is to generate a key with no passphrase (I don't know the security consequences of this! but this is for test only) .

    To take the passphrase out of your key use this command:

    $ openssl rsa -in key.pem -out newKey.pem

    and use the new key in the previews configuration line

提交回复
热议问题