When I try to proxy this request http://localhost:9000/rpc , I get:
cannot proxy to https://example.appspot.com:80 (write EPROTO 101057795:error:140770FC:SSL routines: SSL23_GET_SERVER_HELLO:unknown protocol:openssl\ssl\s23_clnt.c:794:)
webpack-dev-derver config:
devServer: { contentBase: "./", hostname: 'localhost', port: 9000, proxy: { '/rpc': { target: 'https://example.appspot.com', secure: false, changeOrigin: true // **Update-2 SOLVED** } } }
I use fetch : fetch('/rpc' ... to make a request and Windows 10 professional to run webpack.
Without proxy: fetch('https://example.com/rpc' ... SSL request works fine.
Refresh. I had to use SSL port 443 (see Steffen's answer).
Now using: https://example.appspot.com:443
But still does not work with secure: true . The console log displays:
cannot proxy to https:
And with secure: false . The console reports: 404 (Not Found)
Update: SOLVED with changeOrigin: true . Docs are here .
source share