It's perfectly working for Http, but not for WebSocket. I did not find the documentation about this. How can I do proxy for WS?
ng serve --proxy-config proxy.conf.json
proxy.conf.json:
{
"/": {
"target": "http://localhost:8080",
"secure": false
}
}
Angular cli uses http-proxy-middleware
for proxy under the hood. take a look at the documentation: https://github.com/chimurai/http-proxy-middleware
there is a websocket ws
boolean option you can use as described in this section:
https://github.com/chimurai/http-proxy-middleware#http-proxy-options
so you can change your config to:
{
"/": {
"target": "http://localhost:8080",
"secure": false
"ws":true
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With